Results 1 to 19 of 19
  1. #1
    Join Date
    Aug 2013
    Posts
    82

    cPanel Migration

    Hi
    I have a good knowledge in cPanel Hosting account migration.


    But today my Internet connection is getting slow down. I want to migrate all account through SSH .

    How to do that?

  2. #2
    Join Date
    Mar 2003
    Location
    WebHostingTalk
    Posts
    16,963
    You can tar the account and rsync it.
    Specially 4 You
    .
    JoneSolutions.Com ( Jones.Solutions ) is on the net 24/7 providing stable and reliable web hosting solutions and services since 2001

  3. #3
    You can generate full backup via SSH and transfer the full backup to new server using rsync and then restore full backup via SSH on the new server..
    || Web Hosting Blog - Web Hosting security & latest web hosting industry Announcements
    || Web Hosting Discussion - A Web Hosting community

  4. #4
    Join Date
    Dec 2007
    Location
    LocalHost
    Posts
    1,303
    You may follow below steps.

    1) On old server, configure WHM backup to save full cPanel of all account on new server's /home directory.

    2) Login to old server via SSH to run backup command.
    Code:
    /usr/local/cpanel/bin/backup --force
    3) Let the backup complete. Once you have full cPanel backup of all accounts on new server, you can restore all accounts from WHM or from SSH.
    YagHost - Pure SSD Hosting | Since 2007 | Average Response Time: 15 min
    Web Hosting | Reseller Hosting | Managed VPS Hosting
    99.9% Server Uptime Guarantee | 24/7 Rapid Response Tech Support | 30 Day Money Back Guarantee
    LopHost.com - Web Hosting Tutorials

  5. #5
    On the source server use command below to generate backups.

    for i in `cat /etc/domainusers | awk {'print $1'} | cut -d: -f1`; do /scripts/pkgacct $i; done

    The above command will generate backups for all accounts on the server in /home folder. Once it is completed, use rsync command to sync these files on the destination server. You can restore it then.
    █ MilesWeb.com - Your Hosting, Our Responsibility!
    cPanel Hosting | Reseller Hosting | WordPress Hosting: SSD Storage & One-click Staging
    VPS Hosting - Managed & Unmanaged KVM & OpenVZ VPS | VPS Reseller
    █ Hosting Servers in [India | UK | US | Romania] - 24/7 Support | Instant Setup | Data Migration

  6. #6
    Also if you are generating backup for all accounts at a time, make sure that you have enough free space.
    || Web Hosting Blog - Web Hosting security & latest web hosting industry Announcements
    || Web Hosting Discussion - A Web Hosting community

  7. #7
    Join Date
    Aug 2013
    Posts
    82
    Hi I gave that command..


    How to check my backup status . How long will take to complete the backup process.

    [email protected] [/home]# /usr/local/cpanel/bin/backup --force
    info [backup] Started at Tue Dec 3 09:09:08 2013
    info [backup] Validating remote transports
    info [backup] Process started in background.
    info [backup] Log file: /usr/local/cpanel/logs/cpbackup/1386050948.log









    Quote Originally Posted by ravi_9793 View Post
    You may follow below steps.

    1) On old server, configure WHM backup to save full cPanel of all account on new server's /home directory.

    2) Login to old server via SSH to run backup command.
    Code:
    /usr/local/cpanel/bin/backup --force
    3) Let the backup complete. Once you have full cPanel backup of all accounts on new server, you can restore all accounts from WHM or from SSH.

  8. #8
    Join Date
    Dec 2007
    Location
    LocalHost
    Posts
    1,303
    Quote Originally Posted by vimansani View Post
    How to check my backup status
    If you re-run the backup command
    Code:
    /usr/local/cpanel/bin/backup
    You will get a message saying:
    Backup process currently running. Pid: xxxx
    This means backup creation is in process.

    Once backup is completed, a mail will be sent to root email ID with log details.

    Backup time depend on size, and server hardware.
    YagHost - Pure SSD Hosting | Since 2007 | Average Response Time: 15 min
    Web Hosting | Reseller Hosting | Managed VPS Hosting
    99.9% Server Uptime Guarantee | 24/7 Rapid Response Tech Support | 30 Day Money Back Guarantee
    LopHost.com - Web Hosting Tutorials

  9. #9
    Join Date
    Aug 2013
    Posts
    82
    Now backup is completed. But there is have only few accounts backup only. I have more than 40 Domains. But there is have 10. Why is that?

  10. #10
    Join Date
    Aug 2013
    Posts
    82
    any body know how to terminate reseller account using SSH ?

  11. #11
    Join Date
    May 2013
    Location
    India
    Posts
    748
    That should be because of your backup configuration; you shouldn't have all users in backup configuration. You can find the script provided by Miles web to generate backups. Please make sure to run it in a screen. If you can set SSH key between both machines, that will make this easier. You can use a script as follows to generate and copy the backup to remote server.

    1. Install SSH key from source server to target server
    2. Run following script in a screen

    for i in `cat /etc/trueuserdomains | awk -F" " {'print $2'}`; do /scripts/pkgacct $i; scp /home/cpmove-$i.tar.gz <target server IP>:/home; rm -f /home/cpmove-$i.tar.gz; done

    3. When the backup is completed take a list of users from source server using the following command

    cat /etc/trueuserdomains | awk -F" " {'print $2'} > /root/userlist.txt

    4. SCP it to the target server

    scp /root/userlist.txt <target server IP>:/root

    5. Log into the target server. Now run the following script to restore backups.

    for i in `cat /root/userlist.txt`; do /scripts/restorepkg $i; done

    Thats it!

  12. #12
    Join Date
    May 2013
    Location
    India
    Posts
    748
    Quote Originally Posted by vimansani View Post
    any body know how to terminate reseller account using SSH ?
    To terminate any account in cPanel, use the following command. make sure to specify the correct username when you use it.

    Code:
    /scripts/killacct <cPanel user name>

  13. #13
    Join Date
    Aug 2013
    Posts
    82
    Thank you for your reply. I need to terminate cPanel reseller accounts.


    In WHM there is have an option to delete all domains in a single reseller account.









    Quote Originally Posted by nixtree View Post
    To terminate any account in cPanel, use the following command. make sure to specify the correct username when you use it.

    Code:
    /scripts/killacct <cPanel user name>

  14. #14
    Join Date
    May 2013
    Location
    India
    Posts
    748
    AFAIK, there is no single cPanel script can do it. You will have to write a small script to find all users of a reseller and apply "/scripts/killacct" to each of them, including reseller; it should be very simple.

  15. #15
    Join Date
    Aug 2013
    Posts
    82
    Is this fallowing command is correct

    `cat /etc/trueuserdomains | awk -F" " {'print $2'}`; do /scripts/pkgacct $i; scp /home/cpmove-$i.tar.gz <target server IP>:/home; rm -f /home/cpmove-$i.tar.gz;


    I'm getting something like this output

    [email protected] [/]# cat /etc/trueuserdomains | awk -F" " {'print $2'}`; do /scripts/pkgacct $i; scp /home/cpmove-$i.tar.gz <target server IP>:/home; rm -f /home/cpmove-$i.tar.gz;
    >










    Quote Originally Posted by nixtree View Post
    That should be because of your backup configuration; you shouldn't have all users in backup configuration. You can find the script provided by Miles web to generate backups. Please make sure to run it in a screen. If you can set SSH key between both machines, that will make this easier. You can use a script as follows to generate and copy the backup to remote server.

    1. Install SSH key from source server to target server
    2. Run following script in a screen

    for i in `cat /etc/trueuserdomains | awk -F" " {'print $2'}`; do /scripts/pkgacct $i; scp /home/cpmove-$i.tar.gz <target server IP>:/home; rm -f /home/cpmove-$i.tar.gz; done

    3. When the backup is completed take a list of users from source server using the following command

    cat /etc/trueuserdomains | awk -F" " {'print $2'} > /root/userlist.txt

    4. SCP it to the target server

    scp /root/userlist.txt <target server IP>:/root

    5. Log into the target server. Now run the following script to restore backups.

    for i in `cat /root/userlist.txt`; do /scripts/restorepkg $i; done

    Thats it!

  16. #16
    Join Date
    May 2013
    Location
    India
    Posts
    748
    for i in `cat /etc/trueuserdomains | awk -F" " {'print $2'}`; do /scripts/pkgacct $i; scp /home/cpmove-$i.tar.gz <target server IP>:/home; rm -f /home/cpmove-$i.tar.gz; done

    is the complete command

  17. #17
    Join Date
    Aug 2013
    Posts
    82
    Ok Now file transfer is completed. By mistake I moved file to a different server. Can I move that backup to the right server. Where is my files stored in new server.

    After fallowing command.

    for i in `cat /etc/trueuserdomains | awk -F" " {'print $2'}`; do /scripts/pkgacct $i; scp /home/cpmove-$i.tar.gz <target server IP>:/home; rm -f /home/cpmove-$i.tar.gz; done













    Quote Originally Posted by nixtree View Post
    for i in `cat /etc/trueuserdomains | awk -F" " {'print $2'}`; do /scripts/pkgacct $i; scp /home/cpmove-$i.tar.gz <target server IP>:/home; rm -f /home/cpmove-$i.tar.gz; done

    is the complete command

  18. #18
    Join Date
    May 2013
    Location
    India
    Posts
    748
    The backup files will be stored in /home on the remote server. Please make sure to put it in /home on the correct server as well to let the restore command to work fine.

  19. #19
    Join Date
    Dec 2007
    Location
    LocalHost
    Posts
    1,303
    Quote Originally Posted by vimansani View Post
    Ok Now file transfer is completed. By mistake I moved file to a different server. Can I move that backup to the right server.
    Use SCP to transfer files between two server.


    Where is my files stored in new server.
    From your command line, it should be in /home.
    YagHost - Pure SSD Hosting | Since 2007 | Average Response Time: 15 min
    Web Hosting | Reseller Hosting | Managed VPS Hosting
    99.9% Server Uptime Guarantee | 24/7 Rapid Response Tech Support | 30 Day Money Back Guarantee
    LopHost.com - Web Hosting Tutorials

Similar Threads

  1. Cpanel to Cpanel Server Migration Expert Needed Urgently
    By sinclairp in forum Systems Management Requests
    Replies: 37
    Last Post: 04-04-2013, 10:54 PM
  2. Migration: cPanel Shared accounts, to a cPanel Reseller, without downtime
    By Lanny in forum Hosting Security and Technology
    Replies: 7
    Last Post: 12-23-2012, 11:09 PM
  3. Full cPanel To cPanel Server Migration
    By Server Management in forum Systems Management Requests
    Replies: 9
    Last Post: 09-24-2012, 08:33 PM
  4. Replies: 4
    Last Post: 04-08-2012, 02:43 PM
  5. migration RAQ4 to CPanel: any migration tool?
    By thenatural in forum Dedicated Server
    Replies: 0
    Last Post: 11-03-2003, 07:27 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •