Best way to move a site from one sever to another

Discussion in 'HTML & Website Design' started by thesamemanhal, Feb 15, 2009.

  1. #1
    Say I have my own (domain+host+contents) at http://www.mysite .com and I just bought a new site say http://www.new .com on a different server, now I want to move it to mysite as a subdomain like http://new.mysite .com.
    The straightforward way I was think is to just download/export everything from the new one and upload/import to mysite (including the databases), well I don't think this is the best (and yet the right) way to do that is because things get really complicated when you have too many databases with many-subdomains in addition to the problems with the user-names and passwords for all the databases.
    How do you guys deal with such kind of processor, there should be an easy way to do that, I think?

    Any idea greatly appreciated...
     
    thesamemanhal, Feb 15, 2009 IP
  2. shadow_of__soul

    shadow_of__soul Member

    Messages:
    113
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #2
    Hi,

    the best process to make what you need it's:
    1. copy all your files and DB from your old host to your computer
    2. make a backup in your PC
    3. create a subdomain in your new host
    4. create a DB and DB user in yout new host
    5. upload all the files to the directorie assignated to your subdomain
    6. import the DB from your old site to the new one
    7. configure any config file with the DB details
    8. set up a 302 redirect from your old site to the new subdomain if is needed
    9. it's done :D

    if you are insecure about some things in this list, you have 2 options:
    1) search in google your doubts or ask help here
    2) pay $10-$15 USD to some expert to do it :D

    Regards,
    Shadow.
     
    shadow_of__soul, Feb 15, 2009 IP
  3. thesamemanhal

    thesamemanhal Active Member

    Messages:
    1,126
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    55
    #3
    Thank you shadow_of_soul, I exactly did what you have mentioned above (steps from 1 to 7) but here where I am stuck in step 7 when you said:
    7. configure any config file with the DB details
    well this is not as easy as it sounds, why ?
    because, besides too many DB's there are other places where there are links such as www.new .com hard coded into the files everywhere in which they points to the links that we just moved therefore they need be updated too which I also did this (serach&replace) but how about other links like
    forum.new . com
    shop.new .com
    mail.new .com
    .
    .
    .
    all these links were valid previously because they were valid subdomains in previous site, but what about now, should I change all these as well? if the answer yes then here where I think that this is just a bezare thing to go through all these files and updating them manually.
    There should be a way or a tool to do all these steps just automatically, but I am not sure ?

    I was thinking if there is a way to just say backup everything from the new site using a relative path everywhere and restore the backup files into mysite with hope to change all the paths automatically or relatively to mysite's. Is this possible at all ?

    Thank you for your help in advance ....
     
    thesamemanhal, Feb 15, 2009 IP
  4. shadow_of__soul

    shadow_of__soul Member

    Messages:
    113
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #4
    Hi,

    check if in the files you have the links to the page like this:

    <a href="http://old.com/website.html"

    if you have it, replace it to:

    <a href="/website.html"

    so if you move again the site you dont need to do this again :D (there are relative paths :D)

    all of this you need to do it manually, anyway you can use a code editor (like geany) and use the search/replace function to make it. i dont know if exist some tool to make it automatically.

    for the links like forum.new.com etc.. you need to do the manually method or use another 302 redirection from your old site to your new url (i recommend to use the manually method :D)

    also, check if in your config file of your script, dont have defined the url, if it have surely changing that, you have all changed.

    i hope i help you with this :D

    Regards,
    Shadow.
     
    shadow_of__soul, Feb 15, 2009 IP
  5. thesamemanhal

    thesamemanhal Active Member

    Messages:
    1,126
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    55
    #5
    I agree, this was really a bad cod from the original designer (never ever hard code the complete url from your own site).

    Well, if there is no easier way then I guess I'll have to (still long way to go :) ).

    Does anyone think that backup/restore from the old site to mysite may help in this situation ?

    Thanks,

     
    thesamemanhal, Feb 15, 2009 IP