Article ID: 943, created on Oct 6, 2008, last review on Sep 7, 2016

  • Applies to:
  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux

Question

How to replace IP addresses for objects in Plesk?

Answer

Note: Before manipulating the database, it is strongly recommended to create a backup (KB #881 How to backup/restore a Plesk database dump?).

For Windows, please refer to #120484 article.

In the most simple case where all domains' IPs need to be updated to a single value, use the command below:

# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -Ns -uadmin -D psa -e 'select name from domains' | awk '{print "/usr/local/psa/bin/domain --update " $1 " -ip <IP address> "}' | sh

Note: replace <IP address> with the IP that needs to switch to. This IP should already exist in the system.

Omit the last | sh directive to preview the output of the command before executing it.

If a more complex IP change have to be performed (for example, if there are more than one destination IP and switches should be done between multiple IPs), then use reconfigurator.pl script.

The utility ${PRODUCT_ROOT_D}/reconfigurator.pl is developed to replace IP addresses assigned to objects (domains/clients/resellers) in the Plesk database and to reconfigure object settings with the new IPs:

# /usr/local/psa/bin/reconfigurator.pl
Plesk reconfigurator - utility to change IP addresses used by Plesk

Usage: /usr/local/psa/bin/reconfigurator.pl { <map_file> | --autoconfigure | --remap-ips | --help }

If <map_file> does not exist, a template will be created .Otherwise, it will be used to map IP addresses.

--autoconfigure option will attempt to create and process IP mapping automatically. Any new excessive or old unmapped IP addresses will retain their status and would need to be handled manually either by rereading IP addresses or by passing a correct map file to this utility.

--remap-ips is an alias for --autoconfigure option.

--help option displays this help page.

Follow these steps to perform the IP address replacement:

  1. Make sure that the new IP addresses are not registered in Plesk on the Server > IP Addresses page. If they are, remove them before proceeding further.

  2. Run the utility to create the mapping template file:

    # /usr/local/psa/bin/reconfigurator.pl ipaddresses.map
    

    Then, edit this file and set the appropriate IP mapping. The mapping file matches the full list of the currently configured IP addresses with new ones in the following format:

    #cat ipaddresses.map
    eth0:192.0.2.2 255.255.255.0 -> eth0:192.0.2.2 255.255.255.0
    eth0:192.0.2.3 255.255.255.0 -> eth0:192.0.2.3 255.255.255.0
    

    Edit the file and replace an IP address in the right part of a string with one from the new set:

    eth0:192.0.2.2 255.255.255.0 -> eth0:new_ip_address 255.255.255.0
    
  3. Once the mapping file contains an appropriate arrangement, run reconfigurator.pl again:

    # /usr/local/psa/bin/reconfigurator.pl ipaddresses.map
    

    It will read the mapping file and perform the replacement according to its content.

  4. Repair the configuration for Plesk services:

    # /usr/local/psa/bin/repair -r
    

Additional information

In case of any issues refer to KB #113416 "Changing IP address fails with error: no such network interface".

Search Words

Site is gone

too many open files

ip migration

reconfigurator.pl

address is already used by Plesk

replace IP address

Plesk NAT

migration

replace IP addresses

replace IP addresses in Plesk

56797cefb1efc9130f7c48a7d1db0f0c 29d1e90fd304f01e6420fbe60f66f838 a914db3fdc7a53ddcfd1b2db8f5a1b9c 01bc4c8cf5b7f01f815a7ada004154a2 0a53c5a9ca65a74d37ef5c5eaeb55d7f aea4cd7bfd353ad7a1341a257ad4724a 2a5151f57629129e26ff206d171fbb5f e335d9adf7edffca6a8af8039031a4c7 742559b1631652fadd74764ae8be475e

Email subscription for changes to this article
Save as PDF