How to transfer accounts between cPanel server
- Category : WHM questions
- Posted on : Sep 11, 2020
- Views : 1,405
- By : HostSEO
cPanel offers convenient tools to perform content migration. In some cases, you will only need to use a Transfer Tool and switch DNS. More complex setups require additional steps to finish the migration. In any case, we hope that this manual will make the process easier for you.
Over the course of this manual, we use both WHM and command-line to perform necessary actions (SSH credentials are provided after server purchase). WHM is user-friendly and works great for standard actions. However, some steps are either much faster to do from the command-line or not doable from the graphical interface at all.
NOTE: If not stated otherwise, commands should be run on the destination server. Bold text in commands should be replaced with your own data.
Basic steps
This is a simplified workflow that is likely to work if you have a recent and default cPanel setup on servers set up by Namecheap. If the source server has a recent cPanel setup and you did not tweak the server a lot, it can be sufficient.
If this does not work, you will need to check the extended version below and/or do research on your end.
1. Run this one-liner to make sure that no major issues are present.
mkdir -p /root/rpmdb_bak && cp -avr /var/lib/rpm/* /root/rpmdb_bak && rm -vf /var/lib/rpm/__db* && rpm --rebuilddb -vv && /scripts/check_cpanel_rpms --fix && /scripts/upcp --force && whmapi1 set_local_mysql_root_password password="$(openssl rand -base64 14)”
2. Whitelist source server on destination and vice versa. IPs can be found in WHM >> Basic WebHost Manager® Setup >> Basic Config or in output of ‘ifconfig’/’ip a’ commands. Whitelists can be done as explained here.
Example:
[source] # ifconfig | grep inet | head -1
inet 172.16.0.1 netmask 255.255.255.0 broadcast 172.16.0.255
[destination] # ifconfig | grep inet | head -1
inet 172.16.0.2 netmask 255.255.255.0 broadcast 172.16.0.255
[source] # csf -a 172.16.0.2
[destination] # csf -a 172.16.0.1
3. Start the transfer:
1. Go to WHM >> Transfer Tool;
2. Enter the IP of the source server and root password;
3. Click Scan Remote Server:
Select the accounts you want to transfer and hit Copy:
You will get a transfer session ID and cPanel will provide continuous progress updates. If the total amount of data to transfer is small (let’s say under 10G), you can wait for the transfer to complete in real-time. Otherwise, copy over the transfer session ID to a safe place and close the page. The process will continue and you will be able to get back to it anytime.
4. Once you think that the transfer is over, log into the server and review the session (if you checked before that the transfer is over and there are no errors, just disconnect and get back to it later).
/usr/local/cpanel/bin/view_transfer transfer_id_you_saved_before --overview
5. Check the sites using hosts tools.
6. Use the local hosts file as explained here.
Switch over DNS. In case you have Private nameservers set up, you will need to only update the IP of the nameservers. If the domain is registered with Namecheap, refer here.
Otherwise, find the necessary instructions on the site of your registrar. If you are using other nameservers (for example, Cloudflare), the records from the new (destination) server should be copied over to them. Keep in mind that DNS propagation may last up to 24 hours.
Extended steps
This part explains all steps in much more detail. If you have customized your server by installing extra software, you have more dated software installed, or if something didn’t work after the transfer, this part is for you.
Pre-transfer
Setting up a new server
Before doing the transfer itself, it is a good idea to make the setup as similar to the old server as possible. This way you will have less work to do after the transfer.
1. Make sure that the server is set up correctly, cPanel, and core services work.
mkdir -p /root/rpmdb_bak && cp -avr /var/lib/rpm/* /root/rpmdb_bak && rm -vf /var/lib/rpm/__db* && rpm --rebuilddb -vv && /scripts/check_cpanel_rpms --fix && /scripts/upcp --force && whmapi1 set_local_mysql_root_password password="$(openssl rand -base64 14)”
Below you can find the decryption of the command:
2. PHP version/extensions
For common packages that are supported by cPanel, you may use EasyApache. For less common packages, it is necessary to use PHP Pecl. Both are explained here.
NOTE: EasyApache4 is a wrapper around YUM package manager. If you are familiar with the latter, you can use it instead. Be careful - it does not offer the same sanity checks as WHM GUI.
3. Additional packages
If you have installed anything beyond this list, refer to the up-to-date instructions for that software.
Ensure connectivity between servers
If you have not tweaked/secured your installation, the transfer can be done by using the default ssh port (22) using the root password and source server IP.
If you did secure your server, the easiest way to proceed is to lift wall restrictions and revert to basic settings during the transfer. If you do not want to do that, the following may be useful:
We will not cover further restrictions as they are used very rarely. If you do use them, make the appropriate changes.
Transfer
When transferring sites between servers via cPanel tools, you will have to choose between Express and non-Express methods. The differences can be found here.
Here is a short summary:
- In the case of Express transfers, requests/mails will be redirected to the new server, so no data will be lost (e.g. e-commerce orders). The downside is that if something gets broken, end-users will be affected by it.
- If non-Express mode is used, traffic is not redirected. It means that you will have plenty of time to check and fix possible issues, but new emails/database updates will not be carried over.
There are workarounds. For example, you may transfer accounts without express mode, tweak server settings until they all work, remove the accounts from the new server and re-transfer them with Express mode. If your budget or technical knowledge allows, you may set up things such as database replication, or use third-party service/separate server for email handling, etc. Possibilities are endless and depend on the specifics of your business. This guide does not cover them. Neither does Namecheap offer such services.
Run the transfer
1. Go to WHM >> Transfer Tool;
2. Enter the IP of the source server and root password;
3. Click on Scan Remote Server:
4. Select the accounts you want to transfer and hit Copy:
You will get a transfer session ID and cPanel will provide continuous progress updates If the total amount of data to transfer is small (let’s say under 10G). You can wait for the transfer to complete in real-time. Otherwise, copy over the transfer session ID to a safe place and close the page. The process will continue and you will be able to get back to it anytime.
5. Once you think that the transfer is over, log into the server and review the session (if you checked before that the transfer is over and there are no errors, just disconnect and get back to it later).
/usr/local/cpanel/bin/view_transfer transfer_id_you_saved_before --overview
If you see any errors or warnings, you will need to examine the session more closely (without the overview option):
/usr/local/cpanel/bin/view_transfer transfer_id_you_saved_before | less -R
NOTE 1: if you lost the transfer session ID for some reason, check contents of the /var/cpanel/transfer_session folder.
NOTE 2: transfer session may be full of ‘invalid log entry’ errors. They can be ignored. Fixes to the most common relevant errors you may see in transfer sessions are provided below.
Fixing errors in transfer sessions
Post-transfer
Now it is time to confirm that the sites/other services work correctly after the transfer.
NOTE: If you have used the Express transfer option and something broke, you will see the results immediately. Due to this, we recommend against using this option if you have a heavily customized setup.
Checking the sites
- If your site(s) feature any form of automated tests, run them and act upon the results.
- Check the sites on the new server using hosts tools. Using local hosts file is the most reliable. If you see any errors, check the Fixing post-transfer errors section.
NOTE: Do not use an online hosts tool to make any changes to the site (e.g. create new posts) because the database will be updated with URLs containing hosts.cx instead of your site.
Fixing post-transfer errors
No matter how hard you try to maintain the setup and satisfy software requirements, there is a chance that something will not work after the transfer. The following table covers some of the common issues you will face.
If the error is not on the list, you will need to do the research to fix it. First of all, check the logs. Most likely you will find the answer in the following logs:
If the necessary information is not found in those locations, check the full list of logs under cPanel here.
If you need extra clues on what the error means/how to fix it, the following resources contain the most reliable information:
Regardless of where you get the information, make sure that you fully understand what the suggested actions do to the system before applying them.
Adjusting DNS and local email/FTP clients
After you have transferred the data and made sure that all errors are fixed, it is time to make the site(s) work from the new server
- If you are using a custom reverse DNS (PTR) record, please reach out to us via Live Chat so that we can set the required PTR for the IP of the new server for you. Otherwise, you may face issues with email deliverability on the new server.
- Check email/FTP clients (use the same settings as for the old server, but use IP of the new server as hostname).
- Once the steps above are done, you may proceed to the DNS switch. In case you are using private DNS servers for all domains on the server, you will simply need to register them with new IPs (which can be found in WHM > Edit a DNS Zone menu).
If the domain is registered with Namecheap, refer to this article. Otherwise, find the necessary instructions on the site of your registrar. If you are using other nameservers (for example, Cloudflare), the records from the new (destination) server should be copied over to them. Keep in mind that DNS propagation may last up to 24-48 hours.
If you have reached this point, the transfer is over and all your sites are working from the new server.
That’s it.
Categories
- cPanel Question 47
- cPanel Software Management 29
- cPanel Tutorials 13
- Development 29
- Domain 13
- General 19
- Linux Helpline (Easy Guide) 156
- Marketing 47
- MySQL Question 13
- News 2
- PHP Configuration 14
- SEO 4
- SEO 42
- Server Administration 84
- SSL Installation 54
- Tips and Tricks 24
- VPS 3
- Web Hosting 44
- Website Security 22
- WHM questions 13
- WordPress 148
Subscribe Now
10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!Archive Calendar
Sat | Sun | Mon | Tue | Wed | Thu | Fri |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | 31 |
Recent Articles
-
Posted on : Sep 17
-
Posted on : Sep 10
-
Posted on : Aug 04
-
Posted on : Apr 01
Tags
- ts
- myisam
- vpn
- sql
- process
- kill
- tweak
- server load
- attack
- ddos mitigation
- Knowledge
- layer 7
- ddos
- webmail
- DMARC
- Development
- nginx
- seo vpn
- Hosting Security
- wireguard
- innodb
- exim
- smtp relay
- smtp
- VPS Hosting
- cpulimit
- Plesk
- Comparison
- cpu
- encryption
- WHM
- xampp
- sysstat
- optimize
- cheap vpn
- php-fpm
- mariadb
- apache
- Small Business
- Error
- Networking
- VPS
- SSD Hosting
- Link Building
- centos
- DNS
- optimization
- ubuntu