Unable to restore the Plesk PSA database and not sure what to do? Bobcares has your back.
At Bobcares, we offer solutions for every query, big and small, as a part of our Server Management Service.
Let’s take a look at how our Support Team recently helped out a customer struggling with restoring the Plesk psa database
Why are we unable to restore the Plesk PSA database
Error 1813 (HY000) is a common occurrence while attempting to restore the Plesk PSA database. We will come across the following error message in this scenario:
# ERROR 1813 (HY000) at line 151: Tablespace for table 'psa.APSLicenses' exists. Please DISCARD the tablespace before IMPORT
Moreover, the error also prevents us from creating a dump of the PSA database as seen below:
# mysqldump: Got error: 1932: "Table 'psa.APSLicenses' doesn't exist in engine" when using LOCK TABLES
According to our highly skilled Support Techs, this specific error is due to a corrupted PSA database. Fortunately, they also have a way to resolve the error and have your database working back to normal in no time.
How to restore the Plesk PSA database
- First, we have to connect to the Plesk server through SSH.
- Then, we will create a backup of the files at /var/lib/mysql/psa with the following commands:
# mkdir /root/varlibmysqlpsa/ # cp -a /var/lib/mysql/psa/* /root/varlibmysqlpsa
- Next, we will remove the files with this command:
# rm -rf /var/lib/mysql/psa/*
- Then, we have to remove the PSA database with this command:
# plesk db "DROP DATABASE psa"
- After that, we have to connect to MySQL and then create an empty PSA database:
# MYSQL_PWD=$(cat /etc/psa/.psa.shadow) mysql -uadmin MariaDB [(none)]> create database psa; Query OK, 1 row affected (0.002 sec) MariaDB [(none)]> quit
- Finally, we have to restore the PSA database via the latest daily backup as seen below:
# cd /var/lib/psa/dumps # zcat mysql.daily.dump.0.gz | sed -n '/-- Current Database: `psa`/,/-- Current Database:*/p' | MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin –default-character-set=utf8
This handy solution will help us get rid of the error and restore the PSA database to its normal functioning status.
[Looking for a solution to another query? We are just a click away.]
Conclusion
In brief, the skilled Support Engineers at Bobcares demonstrated how to restore the Plesk psa database
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
0 Comments