I used rsync with -av parameter to migrate a website from one server to another. there was no error displayed but the size of the folders are not the same and the website does not work correctly. so something is missing. Is there a parameter who copies really everything ? i have sudo accounts on both sides ofc.
I check folder size with du -s dir
, the sizes are the following :
old server : 2554620
new server : 2547676
it's in bytes. How do I manage to have the exact copy?
Wordcount output:
old server : 2663 3105 175534
new server : 2665 3107 175594
Its possible some of the files arent satisfying rsync's default size & date. Get rsync to transfer based on check sums instead. It will be slower, but if the file has changed in anyway, it will be transfered.
If you want to check that it will transfer the files you want, add -n to the end of the command to get a dry run. You can then check the list for missing files, or even easier, if you have a specific filename that you know wasn't being transferred before, just grep for it!
UPDATE: If you're not sure if the contents of the folders are the same, then you can check easily with the following:
on each server:
And then compare the md5 check sum which is output, if the number is the same, then you have the same files (e.g. file1 on server1 and on server2) although this doesn't account for the file contents being different
If you want to see what files exist in one, but not in another, then you can of course output directory listings to files:
... on both servers, and then
Just one final thought: