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.

Migrating servers!

Discussion in 'General Discussion' started by dob3rman, Jun 7, 2007.

  1. dob3rman

    dob3rman Active Member

    Joined:
    Feb 13, 2005
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    I have some questions about migrating from server A to server B.
    I ahve followed a tutorial on http://bobcares.com/article46.html.

    I was wondering couple of things:
    - Copying accounts using WHM + RSYNC is better then just RSYNC ?
    - When I finished copying all accounts into the new server (B), I need to RSYNC all in case something change while copying.
    The first RSYNC used is:
    "for user in `cat /home/tomove`; do rsync -avuz -e ssh root@OLDSERVERIP:/home/$user/ /home/$user; done"
    Not sure to understand the /home/tomove. What is suppose to be this directory? Should I replace this by /cpanel/users ?
    Those rsync command lines, I enter them one by one? I mean I wait until the first rsync is done (the home/users) before running the /var/cpanel one.

    - Is the list of rsync complete?
    for user in `cat /home/tomove`; do rsync -avuz -e ssh root@OLDSERVERIP:/home/$user/ /home/$user; done
    rsync -avuz -e ssh root@OLDserverIP:/var/cpanel /var/cpanel
    rsync -avuz -e ssh root@OLDserverIP:/var/lib/mysql /var/lib/mysql
    rsync -avuz -e ssh root@OLDserverIP:/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty/mailman
    rsync -avuz -e ssh root@OLDserverIP:/usr/local/cpanel/base/frontend /usr/local/cpanel/base/frontend
    rsync -avuz -e ssh root@OLDserverIP:/etc/valiases /etc/valiases
    rsync -avuz -e ssh root@OLDserverIP:/etc/vdomainaliases /etc/vdomainaliases
    rsync -avuz -e ssh root@OLDserverIP:/etc/vfilters /etc/vfilters

    - My 2 dns ns1.oldserver.com / ns2.oldsrver.com are now pointing to old ip. I change them to point to new server IP at the end? Once the whole rsync is done?

    I am new to this and I just want to make sure I am on the right track :)
     
  2. sibinkc

    sibinkc Member

    Joined:
    Sep 9, 2006
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    HI,

    >>"for user in `cat /home/tomove`; do rsync -avuz -e ssh root@OLDSERVERIP:/home/$user/ /home/$user; done"
    Not sure to understand the /home/tomove. What is suppose to be this directory? Should I replace this by /cpanel/users ?


    '/home/tomove' is a file which contains the complete set of domains that has to be moved to the new server.

    The command "for user in `cat /home/tomove`; do rsync -avuz -e ssh root@OLDSERVERIP:/home/$user/ /home/$user; done" will read the username one by one and rsync the whole contents of the /home/username directory for all the domains. (We are performing the rsync to ensure that the whole necessary contents of the OLD server has been moved to the NEW server).



    >>Is the list of rsync complete?

    Yes



    >>My 2 dns ns1.oldserver.com / ns2.oldsrver.com are now pointing to old ip. I change them to point to new server IP at the end? Once the whole rsync is done?


    Yes, after moving all the domains to the NEW server and performing the rsync operations we can modify the NameServers to point them to the NEW Server. But before this make sure that all the domains on the new server are working properly as follows (use sampling).

    http://IP of the New Server/~username


    Hope this will help you :)
     
    #2 sibinkc, Jun 7, 2007
    Last edited: Jun 7, 2007
  3. dob3rman

    dob3rman Active Member

    Joined:
    Feb 13, 2005
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    Thanks!

    I will try that now and keep you posted :)
     
  4. jdibben

    jdibben Active Member

    Joined:
    Mar 5, 2005
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    I'm migrating to a new server and am having a problem with the rsync part.


    "for user in `cat /home/tomove`; do rsync -avuz -e ssh root@OLDSERVERIP:/home/$user/ /home/$user; done"


    I can't get that command to work. It keeps telling me that tomove doesn't exist. I've followed these instructions and everything has worked perfectly.

    http://www.webhostinguniverse.com/tutorials/migratecpanel.htm

    Any help would be greatly appreciated.
     
  5. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Your command line is wrong. The way you wrote it, it's thinking you have
    an actual user on your server named "tomove" ....

    I have a server migration script already built that makes sure you get
    everything you need transferred if that would be of any help to you.
     
  6. jdibben

    jdibben Active Member

    Joined:
    Mar 5, 2005
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for the reply!

    Well, what I ended up doing last night was modifying that script to the following.

    rsync -avuz -e ssh root@OLDSERVERIP:/home/$user/ /home/$user

    That seemed to work just fine for me.

    What I really need to do now is make a cron job to run these rsync scripts for the next few days till I change over the ip/dns settings to the new box.

    I'm not so hot with cron. I don't know how to get the root password added in so the scripts will work.

    Any help with that you can provide would be greatly appreciated.
     
  7. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    If you already sync'ed your accounts, you should already have your DNS updated.

    What I would do is update the IP in the zone file on the old server to use the
    new server's IP address so that the move would be effectively instantaneous

    (barring any stale cache at ISPs, of course)

    After setting that, I'd update the DNS servers themselves to the new IP address.

    Doing it this way, the old server provides the new IP address and sends everyone
    to the new server when they connect while the actual DNS waits to be switched.

    Why would you need the root password in any of your scripts?
     
  8. jdibben

    jdibben Active Member

    Joined:
    Mar 5, 2005
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Ohhh, I got you. That's a good idea.

    Will I have to update all 27 web sites zones to the new ip or just set up WHM to have the new ip?

    In response to your last question. Every time I run the sync script it asks me the root password on the old server.

    Thanks!
     
Loading...

Share This Page