While backup plugins are great for automatic backups, there are times when you might want to create a WordPress database backup on its own. Itโs because if it gets erased or corrupted, you stand to lose everything you have written, all the content you created on your website, settings, and configurations. By performing a database backup, you can save things even when the WordPress dashboard is inaccessible.
Fortunately, itโs relatively straightforward to create a database backup using phpMyAdmin. ๐ All you need to do is export your current database. Then, when youโre ready, simply import the backup file to replace the existing version.
In this post, weโll take a closer look at why you should back up a WordPress database. Then, weโll show you how to back up (and restore) your database. ๐พ Letโs get started!
๐ Table of contents:
Why itโs vital to backup WordPress database
No matter what type of website you run, itโs important to regularly back up your database. Most obviously, having a fresh backup on hand makes it easier to fix your site if anything goes wrong.
For example, you might add a piece of code to an important site file that breaks your website. Alternatively, if you get hacked, your site becomes vulnerable to other common security problems like SQL injections and malware.
Additionally, itโs useful to have an up-to-date backup on hand if youโre migrating to a new server or switching web hosts. Or, you might be making changes to your site (like running an update) in a staging environment.
Most users prefer to install a WordPress backup plugin to make automatic backups at frequent intervals. However, there are some benefits to manual database backups.
For instance, if you encounter a security issue like the White Screen of Death (WSoD), you wonโt be able to access your dashboard to make new backups. Instead, you can create a WordPress database backup through the phpMyAdmin interface.
phpMyAdmin is a software that enables you to manage ๐ง your MySQL database easily. While you can use it to back up a WordPress database, you can also edit its tables, rows, and fields. Plus, you can import, export, and delete data here.
How to create a WordPress database backup using phpMyAdmin
Now that you know why itโs important to back up your database, weโre going to show you how to back up a WordPress database. First, youโll need to access phpMyAdmin through your web host.
So, log into your hosting account and navigate to the Databases section. Alternatively, you can often access phpMyAdmin from your cPanel dashboard.
In this instance, scroll down to Databases and click on phpMyAdmin:

Once you can see the phpMyAdmin interface, click on Databases:

You may see multiple databases at this point, so select the one that holds your WordPress data. This will be the database that you created when you installed WordPress.
If youโre not sure what that database is, youโll need to go into your wp-config.php file and check the database name there. Look for the following line: define('DB_NAME', 'YOUR_DB_NAME');
Now, you should be able to see all your WordPress tables. Here, click on the Export tab:

You can choose to export your database using the Quick method or the Custom method. If you choose Custom, make sure SQL is selected as the Format. Meanwhile, check that all database tables have been selected.
Now, in the Output section, check the box that says Save output to a file. Then, use the Compression dropdown box to select None (unless your database is very large):

Under Object creation options, you might want to check the box that says Add DROP TABLE if you want to overwrite your existing database. Or, select IF NOT EXISTS to prevent errors during restores.
Lastly, click on Go to complete your database backup. At this point, all your WordPress data will be saved to your computer.
How to restore a WordPress database using phpMyAdmin
Now that you know how to create a WordPress database backup, you might be wondering how to restore the database using phpMyAdmin. In this instance, youโll replace your current database with the backup that you created in the previous section.
Again, youโll need to open phpMyAdmin which you can do through your web hosting account. Then, select Databases and click on the database where you want to import your backup.
Here, click on Import:

In the File to import section, select Browse and locate the backup file that you created earlier. Then, under Format, use the dropdown box to choose SQL:

Lastly, click on Go to complete the database restore. However, itโs important to note that this process can take some time, especially if your database is very large. Generally, the process can take up to even ten minutes for very large sites.
Conclusion ๐ง
Itโs important to back up your website regularly in case you run into unexpected issues. Additionally, itโs helpful to learn how to create a WordPress database backup manually when you canโt access your WordPress dashboard.
Even if youโre a complete beginner, the process is pretty straightforward. All you need to do is log into phpMyAdmin through your hosting account. Here, export the database to your computer. Then, when you want to restore the database, open phpMyAdmin and import the backup file. ๐พ
Do you have any questions about how to create a WordPress database backup? Let us know in the comments below!