XF 2.2 Moving forum from one directory to another

Hey folks,

Not sure if this is the right place, and I saw a bunch of "post move" issues, but I'm a measure thrice cut once type of guy.

I'm a novice when it comes to this stuff - I'm moving my site from /publichtml to /publichtml/site along with duplicating my existing MYSQL DB and having the /site pull from this "new" DB. (The old site and DB will be for testing and the like only until it's deleted). Is there a guide I missed, or a list of steps I need to follow to make sure this goes smoothly?

Thanks, just super nervous and want to avoid breaking things as much as possible!
 
This guide covers creating a duplicated test installation.

Thanks Brogan! Not sure how I missed this, but it looks perfect!

Just one last question - will I have to do something about redirects? That is currently we post a link to a thread in the forum and it's site.com/index.php?threads/threadtitle/#post-4815162342 Will it auto update, or will I have to do something to keep those links intact?
 

Brogan

XenForo moderator
Staff member
Post content won't automatically update - the URLs will be the same unless you edit the post.

If it's just a test forum then you shouldn't have to worry about redirects as there won't be any traffic.
 
Post content won't automatically update - the URLs will be the same unless you edit the post.

If it's just a test forum then you shouldn't have to worry about redirects as there won't be any traffic.
Thanks!
For the record, the original one is going to be the test forum (it's a long story) so I guess I'll have to update the posts somehow.
 
The easiest way would be to run a query.

SQL:
UPDATE xf_post SET message = REPLACE(message, 'https://example.com', 'https://example.com/site');
Thanks Brogan!

Everything worked fine except for this part. I'm not sure if the host (who handled) did it correctly (does the https:// need to be part of it?) or if I did a poor job of explaining.

Hopefully this example makes sense:

On June 15th, someone posted this:

I added a lot of rules here: https://www.(domain).com/index.php?threads/initial-settings.25529/

And I'm looking for a way to change that post, and all other past posts from https://www.(domain).com/index.php?threads/initial-settings.25529/ to https://www.(domain).com/temp/index.php?threads/initial-settings.25529/

Thanks, and sorry for being a bit thick!


EDIT: I guess you said those post contents won't update so that's just a bit of being stuck. Drats! I did try this:


Alternatively, if you move from the root to the /community directory, this would need to be added to an .htaccess file in the root:


Code:

RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$
RewriteRule (.*) /community/ [R=301]

But it's for an old board. Guess I'll have to find an add on or make some changes. Sorry for missing that!
 
Last edited:
Just change the key part:

SQL:
UPDATE xf_post SET message = REPLACE(message, 'example.com', 'example.com/temp');
Ah, perfect! the host said they ran the query wrong, and once I sent that to them went off without a hitch. Thanks for much for the help today! I thought this would be a nightmare, but it wasn't so bad overall. :)
 
Top