• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Code for the domain and directory?

Jake Bunce

XenForo moderator
Staff member
#2
Im creating a xenforo website on a spare domain with the intention of moving it over to a new domain when its complete.
If the two sites are on the same server then you can probably just copy over the XenForo files to the main site when you are done. Use the same database and library/config.php file. Change the Board URL appropriately:

Admin CP -> Home -> Options -> Basic Board Information -> Board URL

If they are on separate servers then you need to make a full backup on the old server and restore it on the new one:

http://xenforo.com/community/threads/how-to-backup-and-restore-your-forum.7213/
 

DaveL

Well-known member
#3
Hi Jake,

Thanks for your reply. Im going to be moving the site onto a different server.

The problem im facing and which im hoping theres an easy eay to solve it will be for regarding links/images.

Ive currently got the site on domain mysite.co.uk, so images will be mysite.co.uk/images/picture.jpg

Im creating an awful lot of pages with links/images. When I move it to the new server, is there code I can start using so I wont have to go through every page replacing mysite.co.uk with newsite.co.uk
 

Brogan

XenForo moderator
Staff member
#4
Why not just do a replace in the SQL database post table - old URL for new URL?

That's what I did when I migrated from phpBB due to a lot of old links being incorrect.
 

DaveL

Well-known member
#5
Hi Brogan,
That sounds very interesting. Im gussing it just a case of running an SQL query in phpMyAdmin?

If thats correct, I dont suppose you have an example of the query you used at all?

I dont want to have to start making notes of where I need to start changing the URLs when I move the site over!
 

Brogan

XenForo moderator
Staff member
#6
Yes, just run the query from phpMyAdmin.

This is what I used:
Code:
UPDATE xf_post SET message = REPLACE(message, 'old_path', 'new_path');
Take a backup first though, or test it on your localhost, just in case...
 

DaveL

Well-known member
#7
Thanks Brogan, Just to be on the safe side, Does 'oldpath' mean http://www.mysite.co.uk/DCR or www/mysite.co.uk./DCR?

Pending on the answer of this, I think ive got one more question! Really appreciate your help though - Can see why your the fountain of Xenforo knowledge!
 

Brogan

XenForo moderator
Staff member
#8
You only need to enter as much of the string as required to get a positive match.

So you could just enter domain.co.uk (or even just the domain name), omitting the http amd/or www.
 

DaveL

Well-known member
#9
Brillaint, Thanks Brogan.

So by doing that mysite.co.uk/DCR becomes newsite.co.uk/DCR

Would I be best of moving the forum to the root so its not in the DCR folder, or would
UPDATE xf_post SET message = REPLACE(message, 'mysite.co.uk/DCR', 'newsite.co.uk');
Do the job?
 

Brogan

XenForo moderator
Staff member
#10
Whether to install the forum in the root or a sub-directory is a personal choice so I wouldn't like to say :D

It really depends whether you ever intend to have anything else in the root, which may have an index.php for example.