Need a MySQL database backup? Most WordPress hosts, including Kinsta, have automated backups so you don’t have to worry about manually backing them up yourself in case of an emergency.
However, there might be times where you need a copy of your latest MySQL database. This could be because you’re migrating hosts or perhaps you want to do some local development. In any case, you can follow this quick and easy tutorial below on how to two incredibly easy ways to backup your MySQL database.
How to Backup MySQL Database with phpMyAdmin
phpMyAdmin is a free open source tool available via your browser that is used to handle administration of MySQL or MariaDB. It can be used for all sorts of different operations, such as migrating databases, managing tables, indexes, and executing SQL statements. Today we are going to simply export a WordPress MySQL database with phpMyAdmin.
Log in to phpMyAdmin. If you’re a Kinsta client, there is an easy to access link (along with the credentials) to login to phpMyAdmin in the MyKinsta dashboard.
If you’re using cPanel, a link to phpMyAdmin will be located under the “Databases” section.
Click into your WordPress database. Most likely the name will correspond with the name of your site or username.
There are two options you have on the next step. It depends on how you want to use the database.
Option 1 – Quick Export Method
Click on the “Export” tab. If you are going to be using your database in a place where an old version of it doesn’t exist, or if you just want a backup, you can select the “Quick – display only the minimal options.” Then click on “Go.”
This will generate a
.sql file which you can keep as a backup, or restore/import elsewhere. Remember, that the WordPress database only contains the information from your site, the files (plugin/themes) are completely separate and must be downloaded and backed up via SFTP.
Option 2 – Custom Export Method
If are going to be importing your database to a place where it already exists with tables of the same name, you will want to choose the “Custom – display all possible options.”
Scroll down to the object creation options section and select “Add DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT / TRIGGER statement.” This will ensure that it simply overwrites existing tables of the same name.
Then click on “Go.” This will generate a
.sql file which you can keep as a backup, or restore/import elsewhere.
How to Backup MySQL Database in MyKinsta
If you’re a Kinsta client, there are two options for backing up your MySQL database – downloadable backups and external backups.
Backup Your MySQL Database with Downloadable Backups
These are an archive file (
.zip) file containing your entire WordPress site. The archive file contains your website’s files as well as the SQL file containing the contents of your database.
You can find this under the “Backups” tab on your individual sites. Alongside the daily, hourly, manual, and system-generated backups, there is an option called “Download.”
Click on “Create Backup Now.” Creating the backup may take several minutes depending on the size of your site. Once it’s ready, you will get a message via the MyKinsta dashboard and also an email with a download link.
Click on the “Download the backup now!” link in the email or the “Download backup” button in the MyKinsta dashboard.
The backup is a
.zip file. It contains all of your website’s files and a
mysql-database-backup.sql file. Simply unzip it and you have your MySQL database backup.
Backup Your MySQL Database with External Backups
Our external backups add-on allows you to configure automatic WordPress site backups to Amazon S3 or Google Cloud Storage. If you’re looking for a convenient way to add automated off-site backups without having to install a WordPress plugin, our external backups feature is a great option.
To back up your MySQL database with our external backups option, make sure “database” is selected during the configuration process. For more information on how to set up external backups for your WordPress site, check out our knowledgebase article.
If you’re taking the database backup to use elsewhere, be sure to check out our tutorial on how to restore your MySQL database using phpMyAdmin.