Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

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.

share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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