To perform the migration you must follow a few simple steps:
Source server (Old Server)
To create a connection to your remote/source CWP server first you must generate an API Key on your Source CWP server, To create an API key/token, use API Manager (CWP Settings >> API Manager). You can click on the CWP to CWP button and you will have the necessary options selected.
Log in to the CWP panel.
-
First check your SSH port
- Go to Services config > SSH Configuration
- Or login to terminal and check
vi /etc/ssh/sshd_config
-
- Port 2251
- By default the port is 22, if you did not change it.
- Then check and open TCP port. Note that you must have to add the port 2304 additionally for migration to done successfully.
- Go to Dashboard, then click on Firewall
- You will find “Opened TCP \ UDP ports” on the right sidebar
- If it is not listed to TCP IN and TCP OUT
- Go to Firewall Configuration > Main Configuration on top menu of this page
- This will open Contents of File: /etc/csf/csf.conf
- Go to #Allow incoming TCP ports and add your port. In my case Port 2251 and extra port for migration 2304
# Allow incoming TCP ports TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,2030,2031,2082,2083,2086,2087,2095,2096,2304,2251" # Allow outgoing TCP ports TCP_OUT = "20,21,22,25,53,80,110,113,443,2030,2031,2082,2083,2086,2087,2095,2096,587,993,995,2080,2443,2304,2251"
-
- Save Changes
- Go back to dashboard and go to Firewall again to check the port in TCP IN and OUT.
- If everything ok, restart Firewall from the top of the menu.
-
Go back and add your Destination IP to whitelist.
- Firewall Whitelist configuration > Add an entry add the Destination IP (New IP) and restart the firewall.
- Note that if you whitelist IP you need not open port in all cases except Amazon S3, Google Cloud, Microsoft Azure or etc.
-
Now lets setup API connection
- Go to CWP settings and select the option API Manager.
- On the right top, you will find the button ‘Allow new API access’.
- Click on it and you will get a popup window with a bunch of options.
- Short Name: API Name. bdhostit
- Ip Origin: Destination server IP that you want to authorize this API.
- Key code: Click on “Generate” and save it somewhere.
GaKPCAv3qCGpfTd2fr5IQIaxmxCIZjQJKLGgOsGHHltJa4vmpft180kfIzKfbhpB34B9HA - Owner: root
- Format Request: JSON
Select the JSON format and enable the function for the cwp to cwp move. - You can select CWP to CWP option to enable all functions for CWP to CWP migration.
- Enable Functions for
- CWP to CWP
- WHMCS
- CLUSTER CWP
- OR
You can set permission to the API to do the transfer manually.
- The necessary functions are
- Account (add, list)
- Packages (add, list)
- MySQL Databases (add, list)
- MySQL Users (add, list)
- Change of the password (upd)
- Cronjobs Users (add, upd ).
- You can add others as well based on your needs.
-
Now you have to create SSK Key
- Server Settings > SSH Key Generator and then click on Generate new key
- Test SSH
ssh root@185.215.164.96 -p 6316 ssh root@38.242.204.74 -p 63160 "whoami"
Destination Server (New server)
Log in to the CWP panel
Click on Firewall and Go to Whitelist configuration > Add an entry add the Source IP (Old IP) and restart the firewall.
Now go to User Accounts > CWP to CWP Migration