Knowledge Base

How to migrate IP addresses for a HyperVM VPS by using cPanel

This article describes how to migrate IP addresses for a HyperVM VPS by using cPanel.

To do this, follow these steps:

  1. Log in to WebHost Manager.
  2. Under IP Functions, click Rebuild the IP Address Pool:


  3. Under IP Functions, click Show IP Address Usage. The new IP addresses are in the range 198.100.46.*. Make a note of the new IP addresses for the next step.
  4. Under IP Functions, click IP Migration Wizard.

    a. Enter all the new IP addresses in the text box, one per line, and then click Continue:


    b. Leave off the first IP address in your list from step 3 (this is the Main IP address and will be used later), and enter the other IP addresses that you added to the VM, one per line.


    c. Click Continue:


    d. Click Continue:


    e. The page refreshes automatically:


    f. Click the Click here to download an IP translation matrix URL, and save the file on your local computer. The IP translation matrix provides a list of account names, old IP addresses, and new IP addresses that you can use for manual changes to DNS, code, and more:


    g. Click Clicking Here.

  5. Migration to the new IP addresses is almost complete. Now the main IP address needs to be changed:

    a. Under Server Configuration, click Basic Cpanel & WHM Setup.

    b. Scroll down to Basic Config, and change the listed IP address to the IP address that is left over.


    c. Scroll down and click Save Changes.

    d. Under DNS Functions, click Add an A Entry for Your Hostname:


    e. Enter the IP address that you just used in the Basic Config section, and then click Add Entry.

  6. Now the /var/cpanel/mainip file needs to be edited so it contains the correct IP address. You can do this in one of several ways:

    - Log into the VPS command line as root, and edit the file directly.

    - Type “echo IP > /var/cpanel/mainip” from the command line.

    - Alternatively, if root login is disabled on the server, you can run the above echo command in the HyperVm Command Center. Just type the echo command in the Command text box, and then click Execute. To verify the command took effect, type “cat /var/cpanel/mainip”.




  7. The old IP entry also needs to be removed from the /etc/hosts file. All of the previous steps add the correct entry to the hosts file, but they do not remove the old entry. As in the previous step, you can do this in one of several ways:

    - Edit the file directly and delete the line.

    - Type the command “sed -i '/Old-IP-HERE/d' /etc/hosts” (you can also do this from the HyperVM Command Center). Please note that custom DNS setups do not look like this, and require manual editing.




  8. After migration is complete, there should be a temporary cPanel license based on the new IP address.
  9. Verify that you can log into WebHost Manager using the new main IP address.
  10. If you receive a license error, run the /usr/local/cpanel/cpkeyclt program as the root user.
  11. Lastly, please submit a ticket to let us know migration is complete. We will update the cPanel license to a permanent license and update the records in the Customer Portal.