base URL for ocPortal site

Post

Posted
Rating:
#5387 (In Topic #1098)
Any help appreciated here. Our old ocPortal site is on a windows 2008 server shared by other web sites.
We are trying to split them up. The existing URL for my site is:
" www.mySite.com/ocportal/site/index.php"

However, when I put in the new URL
"support.mySite.com/ocportal/site/index.php"

It keeps redirecting to the old URL, which will no longer be valid. We have searched in IIS, the PHP folder, ocPortal folders, etc and have not found anywhere that the URL is hard coded or redirected.

Any idea where we can search for how this URL is getting redirected?
Thanks

Post

Posted
Rating:
#5389
It should be in info.php, the base_url setting.

Post

Posted
Rating:
#5391
Found it Chris, thanks!

Post

Posted
Rating:
#5395
Sigh. Not out of the woods yet. Changing the base URL does not affect the explicit URL path for content in "my_downloads" or the wikis.

All the content has the URLs for the www address. For example, in my_downloads:
"http://www.mysite.com/ocportal/uploads/website_specific/my_downloads/Releases and Updates/Senergy_v18.1/HF_181_2.zip"

and the wikis:
"

Code (php)

  1.  
"

Any way to change these programmatically? I have hundreds, maybe thousands of links.

Thanks, any feedback appreciated.

Post

Posted
Rating:
#5399
OK, I found where in mySql I can change the URLs in ocp_download_downloads. Looking for how to change the links to other pages in the wikis.

Anyone have any idea if I can use relative URLs instead of fully qualifying them?

Post

Posted
Rating:
#5400
Hi,

Easiest thing would be to do an SQL export from (e.g.) phpMyAdmin, then do a search and replace in a text editor (e.g. Notepad++), then reimport.

That may corrupt compiled Tempcode in the database, but I think it will auto-regenerate itself if corrupted.
If not, we can discuss that.

It is also possible to use SQL REPLACE queries direct on the database.

I will reply again with more details.

Post

Posted
Rating:
#5401
Yes, that is what I meant: doing a direct SQL replace on "ocp_download_downloads.url".
Problem is, I cannot find the db table where the wikis are stored, and cannot find them on the file system.

Thanks for you help, any info appreciated.

Post

Posted
Rating:
#5403
Right…

To be clear to anyone reading, what I write is applicable to ocPortal (v9), not Composr. Composr has changed in a couple of ways.

Wiki+ content is stored in the seedy_pages and seedy_posts table. That's legacy naming, we renamed it a couple of times.

However, the actual text is likely in the translate table. Almost all text is there, as it is subject to translation.

You can do string replaces in SQL like this…

Code (SQL)

UPDATE tablename SET fieldname=REPLACE(fieldname, 'https://old.example.com/', 'https://new.example.com/');
 
Replace tablename and fieldname as appropriate. For the translate table, you'll also want to clear out text_parsed, wherever there is a match so it gets regenerated. e.g.:

Code (SQL)

UPDATE ocp_translate SET text_original=REPLACE(text_original, 'https://old.example.com/', 'https://new.example.com/'), text_parsed='' WHERE text_original LIKE '%https://old.example.com/%';
 

If the text_parsed column is blank (as set above), or corrupted in some way, it'll get auto-regenerated. I've just confirmed that.

Sorry I'm being slow to reply at the moment, I've really been bogged down since moving house.

Post

Posted
Rating:
#5413
Thanks a bunch Chris, that helps a lot!
2 guests and 0 members have recently viewed this.