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.

How to manually migrate from Plesk, Ensim, or DirectAdmin

Discussion in 'Migrate to cPanel' started by JeffP., Nov 15, 2012.

  1. JeffP.

    JeffP. Well-Known Member

    Joined:
    Sep 28, 2010
    Messages:
    164
    Likes Received:
    9
    Trophy Points:
    18
    Note: the examples in this guide use the root account for logging into via scp. This is for demonstration purposes only. Logging in as root is a poor security practice. You should use an unprivileged account when copying data between 2 servers instead of using the root account.

    Typically accounts are migrated from Plesk, Ensim, or DirectAdmin by using WHM >> Copy an Account From Another Server (or Copy Multiple Accounts/Packages From Another Server). There are times when this may not work. For example:

    • Network connectivity between the source and destination servers may be poor, causing the migrations scripts to timeout
    • There may be outstanding bugs in the migrations scripts which can only be resolved by migrating manually

    Migrating accounts manually is a surprisingly simple task. All that needs to be done are the following:

    1. Populate /etc/trueuserdomains on the source server
    2. Package an account of your choice into a single file
    3. Copy the packaged account to the cPanel server
    4. Restore the account on the cPanel server



    1. On the source server (e.g., Plesk, Ensim, or DirectAdmin), download the script that builds the list of accounts at /etc/trueuserdomains:

    Code:
    # wget http://httpupdate.cpanel.net/cpanelsync/transfers_DEVEL/pkgacct/updateuserdomains-universal
    and the script that packages the accounts (choose one):

    Plesk
    Code:
    # wget http://httpupdate.cpanel.net/cpanelsync/transfers_DEVEL/pkgacct/pkgacct-pXa
    Ensim
    Code:
    # wget http://httpupdate.cpanel.net/cpanelsync/transfers_DEVEL/pkgacct/pkgacct-enXim
    DirectAdmin
    Code:
    # wget http://httpupdate.cpanel.net/cpanelsync/transfers_DEVEL/pkgacct/pkgacct-da

    2. Make them both executable:

    Code:
    # chmod +x updateuserdomains-universal
    # chmod +x pkgacct-*
    
    3. Execute updateuserdomains-universal:

    Code:
    # ./updateuserdomains-universal
    Now there should be a plain text file at /etc/trueuserdomains that contains a list of accounts that can be packaged.

    4. To package an account, select a user from /etc/trueuserdomains (we'll use "alice" in the example below), and run the pkgacct file that you downloaded in the previous steps (we'll use 'pkgacct-pXa' for Plesk from this point forward. If you are using Ensim, you would execute pkgacct-enXim, and if you are using DirectAdmin, you would use pkgacct-da):

    Code:
    # ./pkgacct-pXa alice
    This will package the entire account to a single file here:
    /home/cpmove-alice.tar.gz

    The amount of time that this process takes will depend on the size of the account. I would strongly advise running the "screen" command before packaging (and restoring) accounts. This will allow the package/restore processes to continue even if you get disconnected from the server.

    Also, if the /home directory is too small, you can specify which partition to use like this:
    Code:
    # ./pkgacct-pXa alice /disk1
    where "/disk1" is only an example, and likely does not exist on your server. If it did, and if you ran that command, then you would end up with a file here:

    /disk1/cpmove-alice.tar.gz


    5. Copy the archive to the new server by running this from the source server:
    Code:
    # scp /home/cpmove-alice.tar.gz root@x.x.x.x:/home
    or, run this from the cPanel server:
    Code:
    # cd /home
    # scp root@x.x.x.x:/home/cpmove-alice.tar.gz .
    
    6. On the cPanel server, after running "screen" (if you choose to use screen), run these commands to restore the account:

    Code:
    # cd /home
    # /scripts/restorepkg cpmove-alice.tar.gz
    
    Note that you can remove the /home/cpmove-${USER}.tar.gz files as soon as you are done with them if you'd like. This can help to free up some space on the /home partition.

    If anyone has any questions, please feel free to let us know.

    Don't forget that cPanel has a migrations team that can do all of this for you - for completely free! See my signature below to open a ticket on our helpdesk or head over to Migrate to cPanel | cPanel, Inc. and we can schedule a migration for you.

    Thanks!
     
  2. dzamanakos

    dzamanakos Active Member

    Joined:
    Feb 15, 2014
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi, thanks for the thread. saved hours of work with this method.

    Just some points after using it, that may help some people.

    My scenario is move from a running DA server to a running CPANEL server, so we need to change also the site's ip.

    I'm using RELEASE version so i changed the wget to :
    wget http://httpupdate.cpanel.net/cpanelsync/transfers_RELEASE/pkgacct/updateuserdomains-universal
    wget http://httpupdate.cpanel.net/cpanelsync/transfers_RELEASE/pkgacct/pkgacct-da

    After importing the account you should then click on whm "reset a dns zone" and reset the zones for the domains moved.
    Then click on "edit dns zone" and remove any old TXT record (for example SPF records).

    Under "list accounts" you should press on domain's + link and add an email for the customer and change the package by pressing "change plan" (default has no package, at least in my setup).
     
  3. JeffP.

    JeffP. Well-Known Member

    Joined:
    Sep 28, 2010
    Messages:
    164
    Likes Received:
    9
    Trophy Points:
    18
    transfers_RELEASE isn't for the RELEASE tier of cPanel. You should always use _DEVEL. If that doesn't work, try _PUBLIC. If that still doesn't work, open a ticket so we can see what the issue is.
     
  4. huglester

    huglester Registered

    Joined:
    Dec 12, 2014
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    after running the : ./updateuserdomains-universal
    I got the correct file under: /etc/trueuserdomains

    But when I run:
    ./pkgacct-pXa user

    I get:
    MySQL error: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) at /tmp/.perl-ppk-mOFcLA/scripts/main.pl line 2636.

    why it is not using plesk password? maybe I somehow can pass it?

    Thank you!
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    This is typically resolved by populating the /root/.my.cnf file on the Plesk server with the correct admin credentials.
    Code:
    # cat /etc/psa/.psa.shadow
    # vi /root/.my.cnf
    [client]
    user=admin
    password=(password from the first command)
    Feel free to open a support ticket if the issue continues so that one of our migration specialists can take a closer look.

    Thank you.
     
  6. huglester

    huglester Registered

    Joined:
    Dec 12, 2014
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    well I see that this file was already created, and has valid credentials.
    only password was inside ''
    But I tried to replace them - same problem.

    Error shows - that it tries to access mysql without password :(

    should I go here?

    /https://tickets.cpanel.net/
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You can follow the instructions here when submitting a migration support ticket:

    Migratation Process

    Thank you.
     
  8. madmanmachines

    madmanmachines Well-Known Member

    Joined:
    Nov 28, 2014
    Messages:
    94
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hi,

    Since this thread was bumped somewhat recently, I thought I would add that the script to compile usernames cuts off at 8 characters, which may be confusing at first. The `pkgacct-pXa' script still works with full username.

    Thanks,
     
  9. cPDavidN

    cPDavidN cPanel Developer
    Staff Member

    Joined:
    Mar 19, 2013
    Messages:
    42
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    DataCenter Provider
    If you run this command before running pkgacct-da, it should capture usernames up to 16 characters long:

    export LONGUSERS=1

    If it does not, could you please open a support ticket so we can investigate? Please refer to this forum thread post so we can keep track of the request.

    Thanks,

    David Nielson
    Integration Developer, cPanel
     
Loading...

Share This Page