Article ID: 112699, created on Nov 3, 2011, last review on Aug 17, 2016

  • Applies to:
  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 10.3 for Linux/Unix


During disaster recovery, it is necessary to set up a new Plesk instance and migrate all server settings and customers data from the old server. For some reason, it is not possible to use the solution described in this article:

3072 -- How do I restore Plesk from the hard disk drive when the Operating System is broken and the HDD with an old OS and Plesk is mounted in the new system.


If you prefer to let Plesk professionals handle the migration or upgrade job for you please check out Plesk professional services options on our website:

It is assumed that the hard drive from the old server is mounted to the /old directory on the new server.

Note: On the new server, the same version of Plesk as on the old one should be installed, and it should be licensed properly.

  1. Important: This step is only possible if the version of MySQL server matches for both the original and new servers.

    Start the MySQL server with the datadir parameter in /etc/my.cnf pointing to the MySQL database location on the old drive (/old/var/lib/mysql) and dump databases:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -Ns -e"select name from data_bases where type = 'mysql'" | while read dbname ; do MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin $dbname > $dbname.sql ; done

    Stop MySQL, revert the datadir parameter in /etc/my.cnf to its original value, start MySQL and restore the databases:

    # for f in *.sql ; do dbname=$(echo $f | sed -e 's/\(.sql\)*$//g'); MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin -D$dbname < $f; echo "$dbname restored" ; done
  2. Restore the Plesk database from the available dump:

    a) Stop the Plesk service:

    # /etc/init.d/psa stopall

    b) Start the MySQL server:

    # /etc/init.d/mysqld start

    c) Import the database dump:

    # zcat /old/var/lib/psa/dumps/mysql.daily.dump.0.gz | MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin
  3. Copy the Plesk database password file:

    # cp -rpf /old/etc/psa/.psa.shadow /etc/psa/.psa.shadow
  4. (For Plesk 11.x and later) Copy the encryption key to the new server:

    # cp /etc/psa/private/secret_key /etc/psa/private/
    # cp -rpf /old/etc/psa/private/secret_key /etc/psa/private/secret_key

    Note: it also may be necessary to chmod and chown the file:

    # chmod 0600 /etc/psa/private/secret_key
    # chown psaadm:root /etc/psa/private/secret_key

    These are the correct permissions for this file:

    # stat /etc/psa/private/secret_key
      File: `/etc/psa/private/secret_key'
      Size: 16              Blocks: 8          IO Block: 4096   regular file
    Device: fd00h/64768d    Inode: 49938531    Links: 1
    Access: (0600/-rw-------)  Uid: (  501/  psaadm)   Gid: (    0/    root)
    Access: 2014-07-14 17:35:51.000000000 +0200
    Modify: 2012-11-22 00:14:01.000000000 +0100
    Change: 2014-07-14 17:06:31.000000000 +0200

    Note: if after this, MySQL is not accessible with Plesk credentials (MYSQL_PWD=cat /etc/psa/.psa.shadow mysql -u admin), try restarting the MySQL server using service mysqld restart commend.

  5. Alter the IP_Addresses table if the set of IP addresses assigned to the new server has changed.

  6. Restore domain content:

    # rsync -av /old/var/www/vhosts/ /var/www/vhosts/   
  7. Restore Plesk system users:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin -Dpsa -Ns -e"select s.login, a.password, s.home, from sys_users s, accounts a where = s.account_id" | awk '{ print "PSA_PASSWD=\x27" $2 "\x27 /usr/local/psa/admin/sbin/usermng --add-user --user=" $1 " --homedir=" $3 " --shell=" ($4?$4:"/bin/false")}' | sh -x

    For Plesk 10.x and later, execute the following command:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin -Dpsa -Ns -e"select s1.login, s2.login from sys_users s1 left join sys_users s2 on = s1.mapped_to where s2.login is not null" | awk '{print "/usr/local/psa/admin/sbin/usermng --map-user --user=" $1 " --mapped-to=" $2}' | sh -x
  8. Repair ownership on the virtual hosts' content to fix files and directories owned by non-existent users:

    For Plesk 10.x and 11.x:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin -Dpsa -Ns -e"SELECT s.home, h.www_root, s.login FROM hosting h, sys_users s WHERE = h.sys_user_id" | while read home www_root login ; do content_uid=`stat --format=%u "$www_root"` ; find $home -uid $content_uid -exec chown $login '{}' + ; done

    For Plesk 9.x and earlier:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin -Dpsa -Ns -e"SELECT home, login FROM sys_users" | while read home login ; do content_uid=`stat --format=%u "$home/httpdocs"` ; find $home -uid $content_uid -exec chown $login '{}' + ; done
  9. Restore SSL certificates:

    # cp -p  /old/usr/local/psa/var/certificates/* /usr/local/psa/var/certificates/
  10. Regenerate the web server configuration:

    For Plesk 8.x and 9.x:

    # /usr/local/psa/admin/sbin/websrvmng –a -v

    For Plesk 10.x:

    # /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
  11. Restore mailnames content:

    # rsync -av /old/var/qmail/mailnames/ /var/qmail/mailnames/
    # chown -R popuser:popuser /var/qmail/mailnames/*
  12. Repair the mail configuration:

    # /usr/local/psa/admin/sbin/mchk –-with-spam
  13. Restore DNS zones:

    For Plesk 9.x and earlier:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -Ns -e  "select name from dns_zone" | awk '{ print "/usr/local/psa/admin/sbin/dnsmng update " $1 }' | sh -x

    For Plesk 10.x and newer:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -Ns -e  "select name from dns_zone" | awk '{ print "/usr/local/psa/admin/sbin/dnsmng --update " $1 }' | sh -x
  14. Start the Plesk service:

    # /etc/init.d/psa start

Search Words

plesk upgrade os

failed: Lost connection to MySQL server at


From Plesk 8 to 12


hard driver failed


full restore



restore fails

restore of backup fails

Installation will not continue because your operating system "'Debian' 'Linux' '' 'x86_64'" is not supported

upgrade plesk database

non booting

old HDD

plesk reload

can not restore a backup of the server

imap clients dont authenticate

can't connect to mysql since update

Can't create/write to file '/tmp/ibwwehpp

restore fails error 1

No puedo restaurar backup de todo el servidor

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

Email subscription for changes to this article
Save as PDF