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 /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
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

-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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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.
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.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.