Cpanel is a good system for administrating a server with many sites on it, i’ve used ensim, webmin and a couple of others in years gone by (Plesk and parallels were disasters for me!).  However occasionally something that you think should work just doesn’t and for no obvious reason.

The Cpanel system has a feature to migrate accounts from another server – be it Cpanel or another webhosting panel – this often works, recently though I’ve had a problem with using it for Cpanel to Cpanel where it would connect but fail to transfer the backup file.

Fortunately it’s really easy to use the commandline with cpanel and you can do it manually (actually it’s easier than the wizard!)

On the server you are migrating from just type (while logged in as root!)

/scripts/pkgacct username

This will create a tar.gz in the /home directory on the server – just copy this to the new server (it could take a while – it has everything from the account you are copying).

On the destination server just type in

/scripts/restorepkg username

This creates (or overwrites the account!) on the server – and your done!.  But what if you have a dedicated IP (due to SSL?)

Easy just use this instead

/scripts/restorepkg –ip=y username

This gives it the next free dedicated IP address (make sure you have one free!)

And that’s it – it is honestly easier than the wizard which requires you to add more info to establish the transfer link.

One thing to note is that you should ensure that the versions of cpanel are as near as you can get – otherwise it might fail or do things a little weird.