The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

need api for site migration

Discussion in 'cPanel Developers' started by pawan.rote, Jul 28, 2011.

  1. pawan.rote

    pawan.rote Member

    Joined:
    Jul 28, 2011
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  2. broncha

    broncha Active Member

    Joined:
    Feb 3, 2009
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Kathmandu,Nepal
    cPanel Access Level:
    Root Administrator
    Hi

    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 :)
     
Loading...

Share This Page