Moving from one server to another with rsync?

jw schultz jw at
Wed Jan 21 22:24:00 GMT 2004

On Wed, Jan 21, 2004 at 10:58:03PM +0100, Spear wrote:
> Hi,
> I am currently in the process of migrating from RH 7.3 to RHEL ES 3.0 on my
> system. Of course there is a lot of iles that will need to change server
> (new server is ready). My question is of course what is the best way to do
> this? My thought is rsync with a function like this:
> 1: Running rsync once to get all the files over to my new system
> 2: Running rsync several times to keep the files updated, only
> updating/copying new/changed files to the new server
> 3: running rsync frequently to make sure everything is beeing copied.
> 4: Switching server.

That will work although #1 can be faster with other tools.

> And here are my questions:
> 1: Am i going about this all wrong? *lol*


> 2: Can i keep the user/group permissions?


> 3: Is there a website where i can find information about this kind of move?

Probably.  There are websites for practically everything
even urinals but sometimes it can take more work to find the
website that matches your needs than to figure it out

> 4: Can i get all my http, mysql, sendmail etc copied this way?


> This i what i have done in advance:
> 1: Installed Webmin and synchronized users/groups on both servers


> 2: Upgraded Apache from RH 7.3's 1.x to Apache 2.x..

OK.  Upgrading the source machine to the new version saves
converting the configs as part of the transfer.

> 3: Installed sendmail on the new server with all users and settings from RH
> 7.3

Fine.  Whatever you are comfortable with.

> 4: Installed mySQL with the same settings as on my RH 7.3 system


> 5: Found some information and ran the command:
> rsync --verbose  --progress --stats --checksum --rsh=/usr/bin/ssh --recursiv
> e --times --perms --links /www/kunder/web/* MYHOST:www
> (This worked, however everything was copied into /root/www/* and not into
> /www which i thought i had set up. Furthermore the ownership, chmod and
> groupsettings for files was not copied. The /www/ is the home directory for
> my clients. I guess i will have the same problem when trying this with mySQL
> databases and sendmail etc).

That is because the path on MYHOST you specified was
relative.  If /root is on the same filesystem as /www you
can just mv it.  Otherwise you will probably be better off
removing /root/www and starting over.  The failure to
preserve ownership was because you didn't tell rsync to do
so.  The -a option is a handy shorthand for -rlptgoD
which covers most of the options you will need.

	rsync -avH --rsh=/usr/bin/ssh /www/kunder/web/ MYHOST:/www/kunder/web

Would have been what you want. Or perhaps

	rsync -avH --rsh=/usr/bin/ssh /www/ MYHOST:/www

		are part of -a along with some more options
		you needed.

		If you like noise and have BIG files, ok.
		Me, i'm satisfied with -v.

		Useful sometimes but not really needed, it
		will give you an idea of how much time rsync
		saves in the later rsync runs to keep things

		Not needed and slows things down

> I tried mounting the /www system on my new server through SMB and running
> rsync, but this way i could not get the correct user/group permissions on my
> server.

Ick.  If you are going to use a network filesystem just copy
with cp or cpio -p.  For rsync you want rsync to handle the
network communications (via ssh).

> Hope someone could help or point me in the right direction.
> Best regards, Terje Dahl
> Norway
> -- 
> To unsubscribe or change options:
> Before posting, read:

	J.W. Schultz            Pegasystems Technologies
	email address:		jw at

		Remember Cernan and Schmitt

More information about the rsync mailing list