Large migration - set up test account and change primary domain

monkey64

Well-Known Member
Nov 6, 2011
124
5
68
cPanel Access Level
Root Administrator
I have a forthcoming migration to manage. The website is no problem, but the emails are...

Squirrelmail is used by users to access their email and these accounts need to be migrated.
In total, I have about 7GB of data to backup and restore. I have no issues with the data part of it, but I do have time constraints and 7GB is likely to take all day. I had a time saving idea which I hope is possible...

Here is an example:
I have www.mainsite.co.uk (username: mainsite) which will be the domain I will perform the migration on. I also have www.testsite.co.uk (username: testsite) which I will set up in advance to check the site works, create email accounts, and upload emails.

When I'm ready I would like to modify the testsite account so that the primary domain changes to www.mainsite.co.uk. Provided the DNS is mapped, will WHM allow me to switch the domain? If the emails were already uploaded, simply switching the domain would save me hours. My earlier experiments were not positive.
 
Last edited:

JaredR.

Well-Known Member
Feb 25, 2010
1,834
27
143
Houston, TX
cPanel Access Level
Root Administrator
What you can do is use /scripts/pkgacct with the --skiphomedir argument. This will package everything related to the account except for its home directory - which is what contains the massive amount of e-mail. Copy the archive that /scripts/pkgacct creates to the new server, and restore the account on the new server using /scripts/restorepkg. Then, you can copy important parts of the home directory, such as the .cpanel and public_html subdirectories, and the etc subdirectory that contains the mail account usernames and passwords. Once you are satisfied that everything looks good, you can copy over the mail subdirectory, which contains all of the actual mailboxes.

If you do this, some things will be broken temporarily - you will have mail accounts that have nonexistent mailbox directories (because mail authentication information is stored in the etc subdirectory but the mailboxes themselves are stored in the mail subdirectory) - but this would at least allow you to copy things and see how things look, and have the Web site working while you are transferring the actual mailboxes.
 

monkey64

Well-Known Member
Nov 6, 2011
124
5
68
cPanel Access Level
Root Administrator
Forgot to mention that both accounts are actually on the same server. Would I actually need to use pkgacct?
Is there a simple way to switch the domain?
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
27
143
Houston, TX
cPanel Access Level
Root Administrator
Since the accounts are on the same server, there is no need to use our transfer tools, package the account, or restore it. All you need to do is use Main >> Account Functions >> Modify an Account. It will let you change the account's username and associated domain. No DNS changes are necessary.

You can read about this function in our documentation here:

http://docs.cpanel.net/twiki/bin/view/AllDocumentation/WHMDocs/ModifyanAccount
 

monkey64

Well-Known Member
Nov 6, 2011
124
5
68
cPanel Access Level
Root Administrator
The migration worked, well sort of...

The files were already in place and verified, but for some unknown reason the action of changing the domain and username, changed the directory permission and file ownership and the site didn't load.

I could understand if I had SSH's files from my PC into the home folder, but I hadn't. Strange.