Jul 28, 2011
Hi All,
Below are my requirements:
1] I want to migrate sites from one server to another server.
2] I don't want to keep backup of sites at original place.
3] The migrated site should be restored at another server.
3] I also wish add my custom script to the same.

I know there is option in cPanel > copy account to another server. Later Terminate account. These are two steps which I want to consolidate to single step and also want to add my small custom script at the end.

Please suggest me any API or any way so I can proceed further, any guideline will be appreciated.

Thanks in advance.


Active Member
Feb 3, 2009
cPanel Access Level
Root Administrator

You can call the API 1 function Fileman::fullbackup on the source server specifying the destination by calling with the 'dest' parameter.

This creates the fullbackup of the account and transfers the generated file to the destination server.
To make it easy, use scp and place the backup in /home of the destination server.

If you have a lot of accounts you gonna use up a lot of bandwidth.
(I once did this for like 400+ accounts)

you can perform this in a loop.
Once an account is backed up you can terminate the account using 'removeacct' call.

On the destination server,

You can loop through the tarballs just transferred to /home and use the cpanel script '/scripts/restorepkg'

you can append your script there.

I see this is the best way to do what you are trying to do.

If you need any help PM me :)