The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How To: Move sites with LEAST downtime

Discussion in 'General Discussion' started by WebmastTroy, May 9, 2003.

  1. WebmastTroy

    WebmastTroy Well-Known Member

    Joined:
    Apr 28, 2002
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    6
    Heres the idea....I've run into a few problems with overlapping and such on my server after moving and can imagine that there are hundreds of others with the same issue. Hopefully this can serve as a how-to for people searching for a solution.

    Anyway....

    In order to prevent the LEAST downtime during the transfer of a site from another server, what should you do?

    This is what I did (please correct me if I'm wrong):

    - Copied the sites (very important :cool: )
    - Set all scripts on the old server to use the new server's MySQL database to avoid data loss (be sure to setup MySQL on your new server to accept connections from a host other than localhost - done in CPanel > MySQL Database).

    What kind of solution is there for mail? Is it as simple as changing the MX records on a domain to point to the new server's IP and all mail will be routed there instead?

    Anything else anyone can think of? I might make a feature request that makes it so you can put an account in "Transfer Mode" that will automatically route all FTP, MySQL, mail, HTTP, etc. connections to the new server so there isn't a problem with lost or missing files while the DNS propogates.

    Anyway, all suggestions welcome. I know someone mentioned a How-To section on this forum so hopefully this can be the first one. :D

    -Troy
     
  2. chazzle

    chazzle Active Member

    Joined:
    Apr 10, 2003
    Messages:
    27
    Likes Received:
    0
    Trophy Points:
    1
    I am very interested in a painless way to move sites. My problem is that I am a reseller at the moment and dont have root access on my current machine. I want to move my sites to a dedicated server but one of my clients is not really wanting to make the move. I guess he enjoys the downtime at the current location. Anyway, my client says in order for him to move it would take 10 hours of rescripting his site to accomplish this. His site is based on phpauction and has a lot of current auctions going on.


    Is there a way I can accomplish this for my clients with least amount of rescripting and downtime.
     
  3. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Wow, you and I are in the same boat. However, my client that doesn't want to move has an SSL certificate that he just recently bought. I assume that he would lose it since his IP addy would have to change with the move...Oh well. I'll just have to keep my old reseller account, I guess.
     
  4. WebmastTroy

    WebmastTroy Well-Known Member

    Joined:
    Apr 28, 2002
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    6
    This is almost exactly the problem that I ran into. I have/had root on both boxes but several clients had very active websites. I tried to avoid as much weirdness as possible by copying over the site and then changing the scripts on the old server to look to the new server's MySQL database so that all updates and additions would be made to the new database. The new server was pointed to 'localhost' so there were essentially 2 servers using that 1 MySQL database. As people would begin changing from the old to the new, the data would still be the same.

    My concern is that there are many things that can relate to this such as email (what a pain!), stats, web logs, file changes, etc. About 24 hours after the move, I had a lot of complaints about missing emails. I pointed them to the old IP's webmail and they were able to read the mail that got routed there but this is very inefficient and causes a lot of problems.

    Anyway, I'm hoping somebody will post something I don't know regarding the moving that makes all the problems go away. :)
     
  5. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
  6. WebmastTroy

    WebmastTroy Well-Known Member

    Joined:
    Apr 28, 2002
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    6
    Very interesting read....never heard of that before.

    I'd assume that'd be the same regarding email and everything since the MX records are controlled by DNS.

    I'll have to remember that one next time I have to move. :)
     
  7. DrChaos

    DrChaos Active Member

    Joined:
    Dec 23, 2001
    Messages:
    33
    Likes Received:
    0
    Trophy Points:
    6
    Several hours before you make the move, update the ttl's to 3600 or so. This will actually allow the ttl's to reset to that time period (1 hour) instead of the several hours they are currently set at (14400). Then make the move to the new server using the transfer accounts feature, return to the old server and update the dns in each field to reflect the new IPs, and viola. everything should be running on the new server within the hour. You can either point the sql database to the new server ahead of time or shut down forums for an hour to minimize any loss of info during that hour. Update your nameserver info at your registrar, give it a week to make sure you didn't miss any clients, or have any failed transfers, and if the nameservers are resolving, dump the old server and raise a glass in salute! I don't think anyone even noticed when we made the move, as several clients have asked why we haven't done it yet. They had been expecting downtime and other issues, and had none.
     
  8. rpmws

    rpmws Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    1,824
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    back woods of NC, USA
    here is what I do ..and it can take a while :(

    use multi-copy

    grab 5 sites at a time. watch the screen in WHM copy. Once you see a cpmove-user.tar.gz file apear in the new box home. Imideately delete that dns zone from the other server. Now create a new zone with the new IP. Follow these are they progress. On smaller sites you may grab more at a time. changing your ttl's before you do this globally could help also.

    Once you get sites moved and dns is running from old box, ..go to your registrar and change the IP's for the nameservers all you sites are using. This worked for me on 400 sites. we had no reports of lost anything. Biggest downtime for 1 site was 30 minutes. The rest were seconds to a couple of minutes. Any new traffic to the sites will find new ip right away. Some clients may wind up with stale dns at their isp but that refreshes eventually. Setting a lower ttl will help that. :)
     
  9. advisor

    advisor Member

    Joined:
    Feb 23, 2003
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    1
    can someone help me in moving into a new server in details

    I did't understand the stuff written down above
     
  10. joezeppy

    joezeppy Member

    Joined:
    May 12, 2003
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Why would someone have to move servers anyway?

    Hi,

    I know this might be a super newby question, but if you have a box and are using cpanel, why would you have to move servers anyway.

    Wouldn't it be better just to limit the number of domains or traffic on a server and then when you see it is getting close to whatever capacity they have, just buy a new server for expansion?

    Or is it that certain sites produce higher than expected amounts of traffic?

    Just kind of wanting to understand strategies related to server traffic and the reasons that this is important
     
  11. rpmws

    rpmws Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    1,824
    Likes Received:
    5
    Trophy Points:
    38
    Location:
    back woods of NC, USA
    Re: Why would someone have to move servers anyway?

    reasons:

    1.) (same datacenter) would like to offer faster hardware. Servers do get faster as hardware gets better these days.
    2.) (same datacenter) possible hardware failure, like harddrives. Many times easier to move accounts to a new box for fresh installs. I have seen this done.
    3.) (same datacenter) possible that some account grew too fast and now need moving partial move.

    4.) (move datacenters) obvious reasons, price, new leased hardware ... etc.
    5.) (move datacenters) even if you could take your IPs with you ... time involved in moving machines would be downtime.

    People do this all the time to improve service. Many datacenters have gone belly up also :(
     
  12. joezeppy

    joezeppy Member

    Joined:
    May 12, 2003
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    Thanks rpmws...

    Those sound like valid reasons.

    I guess I'm a little sore because my old hoster, who used Cpanel moved me around a bit too much and didn't seem to care that my shopping carts and scripts, some of which required certs, were being "jacked up" on a regular basis.

    It caused me a lot of grief and is the major reason that I decided to go dedicated.

    Thanks Again.
     
  13. joezeppy

    joezeppy Member

    Joined:
    May 12, 2003
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    1
    P.S...

    Listen RPMWS,

    I'm probably pushing my luck, but you know what they say... "No good deed goes unpunished," and since you were kind enough to answer my newbie question, I wonder if I could trouble you to take a look at and comment on something that really is important for me to understand.

    My post kind of got looked over by those that know what they are doing. It's just kind of sitting there with me hoping for some answers.

    http://forums.cpanel.net/showthread.php?s=&threadid=9924

    TIA
     
Loading...

Share This Page