Product:
Search Type:

How can I restore Plesk database dump?

Article ID: 881 
Last Review: Feb,19 2008
APPLIES TO:
  • Plesk for Linux/Unix

RESOLUTION

Automatical Plesk database dumps are stored in the folder defined by DUMP_D variable value in /etc/psa/psa.conf file.

Automatic dumps consist of two types:

1) daily dumps which are made every night together with `statistics` utility run, dump files has names like mysql.daily.dump.1.gz

2) pre-upgrade dumps which are made during Plesk package update run, that are named like mysql.preupgrade.dump.gz.1

If you wish to perform the database backup manually, it can be done with the command like 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 dump of three databases:

  • psa
  • horde
  • mysql
That is why the following error message may appear when you perform the latest command:

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

It happens because only 'psa' database is needed to be restored. If you need to restore all these three databases, then you have to delete them before restoration using "DROP DATABASE" sql command.

Please provide feedback on this article

Did this article help you solve your issue?
Yes
No
Partially
I do not know yet
 
Strongly Agree   Strongly Disagree
  9 8 7 6 5 4 3 2 1
The article is easy to understand
The article is accurate
Additional Comments:
*Please provide us with your email address in case we need to contact you.
*Please type the code you can see.
* - required fields