[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 194
  • Last Modified:

Moving data to new server - RSYNC question

I've purchased a new server on a new host provider.  I'm trying to copy the httpdocs folder contents and sub folders to the new server.

I've tried this command - but found it brought over the permissions and user & group ownership from the previous server.  I don't want that to happen.

rsync -avz -e ssh root@xxx.xxx.xxx.xx:/var/www/vhosts/sitename.com/httpdocs/ /home/sitename/public_html/  

I could really use help getting the right syntax, please.

How do I copy the file, folders and subfolders -- WITHOUT THE PERMISSIONS, ETC - from the other server?  My attempt has failed.  I don't want to manually change perms and ownership everytime I sync -- I plan to rsync a few times before the final switch over.

Also, a friend of mine insists that I should always use -x, so that I don't copy more than I need.

I think I'm hungup about "-avz"

Please  - whatever help would be appreciated

Thank you in advance
0
U_S_A
Asked:
U_S_A
  • 3
3 Solutions
 
PapertripCommented:
-a is your problem here.

        -a, --archive               archive mode; equals -rlptgoD (no -H,-A,-X)

Open in new window

        -o, --owner                 preserve owner (super-user only)
        -g, --group                 preserve group
        -p, --perms                 preserve permissions

Open in new window

0
 
PapertripCommented:
The other options you will be leaving out by removing -a:
 
       -r, --recursive             recurse into directories
        -l, --links                 copy symlinks as symlinks
        -t, --times                 preserve modification times
        -D                          same as --devices --specials
            --devices               preserve device files (super-user only)
            --specials              preserve special files

Open in new window


The main option there to add back in is -r, but -D and -l are probably worth adding back in as well.
0
 
PapertripCommented:
Well, actually, -D and -l probably won't be needed for the specific directories you are copying, but it is still good to know what is happening for future needs.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now