Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Restore a Plesk database dump  (Read 4938 times)

0 Members and 1 Guest are viewing this topic.

dustin

  • Guest
Restore a Plesk database dump
« on: December 14, 2013, 07:15:44 pm »
Automatic Plesk database dumps are stored in the folder defined by the DUMP_D variable value in the /etc/psa/psa.conf file.

Automatic dumps consist of two types:

Daily dumps, which are made every night together with the running of the statistics utility; dump files have names like mysql.daily.dump.1.gz

Pre-upgrade dumps, which are made when the Plesk package update is run; names are similar to mysql.preupgrade.dump.gz.1

If you want to perform the database backup manually, it can be done with the command below:
# mysqldump -uadmin -p`cat /etc/psa/.psa.shadow` DATABASE_NAME > FILE_NAME.sql

The following example shows how to restore the mysql.preupgrade.dump.gz backup file.
# gunzip /var/lib/psa/dumps/mysql.preupgrade.dump.gz
mysql -uadmin -p`cat /etc/psa/.psa.shadow` -e"DROP DATABASE psa;"
mysql -f -uadmin -p`cat /etc/psa/.psa.shadow` < /var/lib/psa/dumps/mysql.preupgrade.dump

Actually, a standard daily backup file includes a dump of three databases:

psa
horde
mysql

That is why the following error message may appear when you perform this command:

ERROR 1050 at line 3165: Table 'horde_categories' already exists

It happens because only the psa database needs to be restored. If you need to restore all three of these databases, then you have to delete them before restoration using the DROP DATABASE SQL command.

=====