If we have been working with WordPress for some time then at least once we might have come across a situation where a manual or automated WordPress database backup has saved our day. Before explaining the process to create backups let us see why we require backups. While installing new plugins or trying some modifications via our own code change, we may come across a situation where our admin dashboard becomes inaccessible. This might also happen if our website has been hacked (Yes it happens!).
Even though WordPress is a very secure content management system there may be security vulnerabilities introduced to this system by the plugins. There may be also situations where our hosting provider can lose our valuable data or terminate our account due to the expiry of the contract. In all such cases, we are ultimately at the risk of losing our data.
All these facts tell us the importance of keeping regular backups for our WordPress system in the event of unexpected data loss. There are different free as well as premium plugins available that perform the backup automatically. Our WordPress website can be restored from these backups easily. In this blog, I will explain a simple method to create a manual WordPress database backup without using any plugins or doing any code modifications. This does not include taking a backup of the plugin/theme files and folders.
Manual Backup using phpMyAdmin
phpMyAdmin is a commonly known tool among WordPress users. It is an open-source data management system. As we know, WordPress is powered by the MySql database. PhpMyAdmin helps us to manage this database with an easy to use interface. I have already covered topics on local WordPress installation where we have explained about phpMyAdmin.
Now let us proceed with creating the backup. First, we have to log in to the CPanel of our WordPress hosting provider. Under the database section, we will find the phpMyAdmin option. We can also directly login to our phpMyAdmin if we know the URL and credentials.
There may be multiple databases available in the phpMyAdmin. We have to click on the name of the database which we want to back up. The selected database name will be displayed on the top portion as shown below.
Now we have to click the Export option. The next screen has options to specify the output formats and other detailed options to create data and tables. We need to only modify the options to save the output to a file rather than a text. Also, change the Compression option to zipped as shown below.
The other options can safely be set as the default provided values. Finally, click the Go button at the bottom part of this section.
Now a zip file can be downloaded which contains our database backup.
Manual Backup using Cpanel
Another option to create a manual backup of our WordPress database is by using the cPanel.All major hosting services like SiteGround, BlueHost, InMotion, etc provide us with a Cpanel that can be used for a variety of functionalities. For taking database backup first we have to log in to our cPanel by entering the credentials. Inside the cPanel, we have to locate the cPanel Backup option as shown below.
Click on this option to view the backups page. Under the partial backups section, we have our database name displayed as a link. Click on this link to download our database backup as a zip file.
This zip file is exactly the same as the one we have generated in the previous section using phpMyAdmin.
Now that we have the manual database backup as a zip file we can use this to restore our WordPress installation. Refer to this blog to understand how to restore our site from the database backup.
Note: Before wrapping up this blog let us go through some important reasons why we require automated backups in addition to manual backups. The method explained above requires us to log in to the cPanel or phpMyAdmin and do the backup manually which might not be practical in all cases. Also in some cases, our database itself may become corrupt or inaccessible and we may need to restore it with an uncorrupted version. We also need the back up of our files and folders for a complete restoration of our website. This can be done only if we have an automated system to keep regular backups. I have already explained how to keep automated backups using the Updraftplus plugin.