Before making any major changes to your system, including upgrades or any direct database work, we strongly recommend that you back up your database. The following is a method for accomplishing this.
Backing up the Database
The process of backing up the database involves using the command mysqldump. The steps are fairly typical, except that you need to ensure that the character set is UTF-8. To do that, the argument
--default-character-set=utf8 may be passed to both mysql and mysqldump as demonstrated below:
- On the command line, move to the directory in where you would like to store the database. It is recommended that you store this some place that is not outside accessible, as your database contains a lot of sensitive data.
Then run the following:
mysqldump --default-character-set=utf8 -uusername database_name -p | gzip > dump.sql.gz
where username is the username for the Plesk Billing database and database_name is the name of the Plesk Billing database.
- You will be prompted for your database password. Enter it, and a backup will be created in the current directory.
Restoring the database
You only need to restore the database if something went wrong while you were upgrading or making changes, and you need to "start over" from scratch.
- Navigate to the directory where you stored your database backup.
From the command line, run the following:
gunzip -c dump.sql.gz | mysql --default-character-set=utf8