Move accounts between servers except mail

Rogerio

Well-Known Member
Sep 26, 2016
78
15
8
Sao Paulo, Brazil
cPanel Access Level
Root Administrator
Hello,

I have a dedicated server with some accounts, but 3 of them have, together, more than 1 Tb of IMAP mail messages. Both servers are 100 mbits only, and will take a lot of time to transfer.

My ideia is transfer the accounts except the "mail" folders. Reason: I can rsync the mail folders to a separated folder on the new server before transfer everything else and change the DNS. Everyday I can rsync only changes until the migration day. And then do a final rsync in the migration day, replace the "empty" folder with that rsync'ed, transfer everything else (website, mysql, email accounts (passwords), DNS and so), restoring the latest version of /home/user folder.

Any ideas how to accomplish this? I need to do everything in one sunday, so the Transfer Tool for immediate change is not possible.

Thanks.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
Hello @Rogerio,

The easiest approach would be to uncheck Copy Home Directory for those three accounts when using WHM >> Transfer Tool to copy the accounts to the destination server. Then, use rsync to manually transfer the data from the home directories for those accounts (/home/$username/) as needed and in the order you prefer.

Thank you.
 
  • Like
Reactions: Rogerio

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
HI @Rogerio

MySQL databases are stored in the MySQL directory not in /home/$user so they would be unaffected. I would ensure that when you perform the rsync you include all folders besides mail if you want to do that separately.
 
  • Like
Reactions: Rogerio

Rogerio

Well-Known Member
Sep 26, 2016
78
15
8
Sao Paulo, Brazil
cPanel Access Level
Root Administrator
Hello @cPanelMichael and @cPanelLauren

Worked, thank you. But I had to set new GID and UID to each folder on /home/user. How can I fix owner and permissions since the UID/GID are differents in the new server?

And, doing this way, it didnt create /etc/apache2/logs/domlogs/user folder (symlinked on /home/user).

Thanks.
 
Last edited:

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
Hi @Rogerio

You should be able to use chown or usermap/groupmap as described in the rsync man page:

Code:
            --usermap=STRING        custom username mapping
            --groupmap=STRING       custom groupname mapping
            --chown=USER:GROUP      simple username/groupname mapping
 
  • Like
Reactions: Rogerio