Restore Process
Using phpMyAdmin, follow the steps below to restore a MySQL/MariaDB database.
- Login to phpMyAdmin.
- Click “Databases” and select the database that you will be importing your data into.
- You will then see either a list of tables already inside that database or a screen that says no tables exist. This depends on your setup.
- Across the top of the screen will be a row of tabs. Click the Import tab.
- On the next screen will be a location of text file box, and next to that a button named Browse.
- Click Browse. Locate the backup file stored on your computer.
- Make sure SQL is selected in the Format drop-down menu.
- Click the Go button.
Using MySQL/MariaDB Commands
The restore process consists of unarchiving your archived database dump, and importing it into your MySQL/MariaDB database.
Assuming your backup is a .bz2
file, created using instructions similar to those given for Back Up and Restore WordPress database using MySQL/MariaDB commands, the following steps will guide you through restoring your database:
- Unzip your
.bz2
file:
user@linux:~/files/blog> bzip2 -d blog.bak.sql.bz2
Note: If your database backup was a .tar.gz
file called blog.bak.sql.tar.gz
, then
tar -zxvf blog.bak.sql.tar.gz
is the command that should be used instead of the above.
- Put the backed-up SQL back into MySQL/MariaDB:
user@linux:~/files/blog> mysql -h mysqlhostserver -u mysqlusername -p databasename < blog.bak.sql
Enter password: (enter your mysql password)
user@linux:~/files/blog>