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.

Cpanel to cpanel Migration Old server to new server

Discussion in 'Migrate to cPanel' started by Ghansham, Aug 23, 2011.

  1. Ghansham

    Ghansham Member

    Joined:
    Aug 16, 2011
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Hi Experts,

    I want account transfer process cpanel to cpanel. old server to new server.
    But I want command line transfer process. so please help me how to transfer cpanel account with command line.

    OS:- centos


    Thanks in Advance
     
  2. cPanelKeithS

    cPanelKeithS Active Member
    Staff Member

    Joined:
    Oct 14, 2008
    Messages:
    31
    Likes Received:
    1
    Trophy Points:
    8
    /scripts/pkgacct $username

    Where $username is the account owner.

    Then scp the package files to the /home directory on the destination server. Run the following for each account on the the destination server

    /scripts/restorepkg $username
     
  3. Ghansham

    Ghansham Member

    Joined:
    Aug 16, 2011
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Thanks you very much.

    But What about Addon Domains. because there are many addon domains is available how can I restore it there databases and contents.
    please give me more idea about this

    Thanks
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,814
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    The method provided by cPanelKeithS in the above post automatically includes the Add-on domain names and databases. There are no additional steps required to package/restore the add-on domains or databases of the account.

    Thank you.
     
  5. Ghansham

    Ghansham Member

    Joined:
    Aug 16, 2011
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    Thank you.
    can your tell me how to transfer only mails one server to another server?
    and how to transfer only databases one server to another server? please help me...
     
    #5 Ghansham, Aug 24, 2011
    Last edited: Aug 24, 2011
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    There is not currently an option to only transfer email accounts from one server to another. If the domain is the same, you can try these steps, but please note that you will destroy any existing entries in /home/username/etc/domain.com location by doing so. As such, please ensure to make a backup of the account and all files on the account before proceeding:

    On the new server
    Code:
    /scripts/pkgacct username
    cd /home/username
    cp -R etc /root/username-etc.bak110824
    cp -R mail /root/username-main.bak110824
    scp -pr root@oldserverIP:/home/username/etc/domain.com/* /home/username/etc/domain.com/
    scp -pr root@oldserverIP:/home/username/mail/domain.com/* /home/username/mail/domain.com/
    Please replace username with the cPanel username and oldserverIP with the old server's IP address.

    As for databases, simply create a dump of the database and import the dump:

    On the old server
    Code:
    mysqldump --add-drop-table username_dbname > /home/db.sql
    scp -pr /home/db.sql root@newserverIP:/home
    On the new server
    Code:
    mysql -u root username_dbname < /home/db.sql
    Above please replace username_dbname with the database full name and newserverIP with the new server's IP address. Of note, you would need to have already created the MySQL database on the new server prior to importing the sql dump file to that new machine.
     
  7. Ghansham

    Ghansham Member

    Joined:
    Aug 16, 2011
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Hello Guys and Girls,

    I understand all think (cpanel to cpanel migrate process, emails and databases backup and restore) but I can't understand reseller transfer process. Please give me more explanation about reseller migration process. because their are more account and I don't know how to transfer it? please help me.


    Thanks for help.
    Ghansham
     
  8. cPanelKeithS

    cPanelKeithS Active Member
    Staff Member

    Joined:
    Oct 14, 2008
    Messages:
    31
    Likes Received:
    1
    Trophy Points:
    8
    You would need to transfer the reseller first then transfer the accounts it owns. You can find who owns an account easily with the following.

    # grep OWNER /var/cpanel/users/*
     
  9. Ghansham

    Ghansham Member

    Joined:
    Aug 16, 2011
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    It's means First I will transfer his reseller account. then check his ownership account to use this command

    #grep OWNER /var/cpanel/users/*

    and migrate one by one transfer cpanel account
    Is it right?

    Thank for help.
    Ghansham
     
  10. cPanelKeithS

    cPanelKeithS Active Member
    Staff Member

    Joined:
    Oct 14, 2008
    Messages:
    31
    Likes Received:
    1
    Trophy Points:
    8
    Yes, since you want to do itvia command line. Transfer reseller first and then the accounts one by one. If you used the WHM interface, transfer the reseller by itself, then all of his acounts at the same time would be possible.
     
  11. Ghansham

    Ghansham Member

    Joined:
    Aug 16, 2011
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Hello Cpanel Team,

    Thank you Very Much.

    Ghansham
     
  12. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    I did want to mention that you can get a list just of resellers and the accounts (username) owned by those resellers with the following command:

    Code:
    grep -v 'root\|#' /etc/trueuserowners
    This will strip out any accounts owned by root user. Please note that if the reseller does not own their account and root owns the account, then you will not get the return for that reseller's own account.

    This might be helpful if you want to grab a list in command line rather than trying to compile a list manually.
     
  13. Ghansham

    Ghansham Member

    Joined:
    Aug 16, 2011
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    Thanks, It's nice and helpful command.
     
Loading...

Share This Page