1. 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?

Discussion in 'XenForo Questions and Support' started by DaveL, Sep 3, 2011.

  1. DaveL

    DaveL Well-Known Member


    Im creating a xenforo website on a spare domain with the intention of moving it over to a new domain when its complete.

    Is there a way of using xencode so : http://www.mysite.co.uk/DCR/pages/OnAir__BarryBinns

    will automatically point to which ever domain its on? http://www.newsite.co.uk/pages/OnAir__BarryBinns

    Hope that makes sense!
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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:

    DaveL likes this.
  3. DaveL

    DaveL Well-Known Member

    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
  4. Brogan

    Brogan XenForo Moderator Staff Member

    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 likes this.
  5. DaveL

    DaveL Well-Known Member

    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!
  6. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, just run the query from phpMyAdmin.

    This is what I used:
    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 likes this.
  7. DaveL

    DaveL Well-Known Member

    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!
  8. Brogan

    Brogan XenForo Moderator Staff Member

    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 likes this.
  9. DaveL

    DaveL Well-Known Member

    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
    Do the job?
  10. Brogan

    Brogan XenForo Moderator Staff Member

    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.

Share This Page