Mass IP changing in Plesk

Moving a Plesk server behind a firewall is always a pain, since the IPs are associated with domains within the Plesk database. I used to hack the database every time I had to update IPs, but doing this for 50 IPs is… not so good.

Luckily, I stumbled up on this Parallels knowledge base article, which introduces reconfigurator.pl — it reads a mapping of IPs and updates system interfaces as well as all the internal Plesky goodness.

2 Comments

  • mike

    June 12, 2009

    This worked last time I had to move a Plesk server behind a NAT device:

    mysqldump psa > psq.sql
    cp -a psa.sql psa.sql.bak
    sed -i ‘s/35\.192\.3/192.168.100/g’ psa.sql
    sed -i ‘s/35\.192\.28/192.168.100/g’ psa.sql
    sed -i ‘s/IPADDR=35.192.3/IPADDR=192.168.100/g’ ifcfg-eth0\:*
    cat ifcfg-eth0\:*
    /etc/init.d/network restart
    mysql psa < psa.sql
    /usr/local/psa/admin/sbin/websrvmng -a
    mysql -Ns -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e ‘select name
    from domains’ | awk ‘{print “/usr/local/psa/admin/sbin/dnsmng update ”
    $1 }’ | sh
    /etc/init.d/named restart
    /etc/init.d/httpd restart
    /etc/init.d/psa restart
    /etc/init.d/ntpd restart

    Looking at it, the above seems to assume that the Primary Interface has already been reconfigured at the console.

  • admin

    June 13, 2009

    That seems like so much work, comparatively… You always do things the hard way ;)

Leave a Reply