Moving data to new server - RSYNC question

Posted on 2011-10-28
Last Modified: 2012-05-12
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 /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
Question by:U_S_A
    LVL 21

    Accepted Solution

    -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

    LVL 21

    Assisted Solution

    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.
    LVL 21

    Assisted Solution

    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.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
    Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now