I'm moving from one VPS to another, and I figured that the simplest way to transfer data would be rsync.

However, the data is owned by a user, www-data, which doesn't have ssh privileges, and I'd like it to be owned by the same (named) user on the target machine. Obviously I need all file permissions preserved. I have SSH access via another user with sudo privileges on both machines.

Is this possible to do this with rsync?

link|improve this question
feedback

1 Answer

up vote 3 down vote accepted

why not rsync and chown afterwards? alternatively you can temporarily allow root logins to one of the machiens and run rsync.. if run as root - it'll preserve ownership.

link|improve this answer
1  
as a side note, you can do PermitRootLogin without-password to enforce a key login, and then AllowUsers root@ip.add.re.ss to restrict /which/ hosts you will allow root to login from. – cpbills Jun 6 '10 at 14:05
Thanks, it worked. – Leonid Shevtsov Jun 6 '10 at 17:03
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.