Copying Part of the Mail folder to new hosting
I have just transferred several mail accounts from one cpanel hosting account to another. Everything is working but there was a gap between when I ran the backup and moved the files over to when I transferred the DNS so the are about a week or so of emails missing. I have a current backup of the mail folder from the old hosting account but I am afraid to copy it all over in case it over writes any emails that have arrived this morning. Is it possible to just select the last two weeks of emails in the cur folder and copy them over via ftp or will I also need to update over files?
-
You would want to use rsync, it will only copy the emails that do not exist in the new location, example: # rsync -ahvz /backup/user/mail/domain.com/ /home/user/mail/domain.com/
The first path is the path to the current backup where you want to sync the emails FROM, and the second path is the current path to where the live emails reside. If you are using rsync as root, you will want to chown the mail folder as the user after running rsync# chown -R user: /home/user/mail/domain.com0 -
Hello, You may also want to run the following command when using instructions like the one in the previous response: /scripts/mailperm $username
Thank you.0 -
You would want to use rsync, it will only copy the emails that do not exist in the new location, example:
# rsync -ahvz /backup/user/mail/domain.com/ /home/user/mail/domain.com/
The first path is the path to the current backup where you want to sync the emails FROM, and the second path is the current path to where the live emails reside. If you are using rsync as root, you will want to chown the mail folder as the user after running rsync# chown -R user: /home/user/mail/domain.com
Just to note the rsync command 'rsync -ahvz' doesnt properly copy hard links. and may cause email usage to bloat0
Please sign in to leave a comment.
Comments
3 comments