dob3rman

Active Member
Feb 13, 2005
29
0
151
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 [email protected]:/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 [email protected]:/home/$user/ /home/$user; done
rsync -avuz -e ssh [email protected]:/var/cpanel /var/cpanel
rsync -avuz -e ssh [email protected]:/var/lib/mysql /var/lib/mysql
rsync -avuz -e ssh [email protected]:/usr/local/cpanel/3rdparty/mailman /usr/local/cpanel/3rdparty/mailman
rsync -avuz -e ssh [email protected]:/usr/local/cpanel/base/frontend /usr/local/cpanel/base/frontend
rsync -avuz -e ssh [email protected]:/etc/valiases /etc/valiases
rsync -avuz -e ssh [email protected]:/etc/vdomainaliases /etc/vdomainaliases
rsync -avuz -e ssh [email protected]:/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 :)
 

sibinkc

Member
Sep 9, 2006
11
0
151
HI,

>>"for user in `cat /home/tomove`; do rsync -avuz -e ssh [email protected]:/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 [email protected]:/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 :)
 
Last edited:

dob3rman

Active Member
Feb 13, 2005
29
0
151
Thanks!

I will try that now and keep you posted :)
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
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.
 

jdibben

Active Member
Mar 5, 2005
28
0
151
Thanks for the reply!

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

rsync -avuz -e ssh [email protected]:/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.
 

Spiral

BANNED
Jun 24, 2005
2,018
8
193
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.
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.

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.
Why would you need the root password in any of your scripts?
 

jdibben

Active Member
Mar 5, 2005
28
0
151
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!