How to backup WordPress database without using Plugin »Compa Marketing

While we love WordPress for so many great reasons, there's no denying the fact that it's vulnerable to vulnerabilities when not handled properly and can lead to serious damage.

So if you have a WordPress site, it is essential that you take care to stay away from people following you. One of the important maintenance steps in this regard is backing up your site regularly.

You can hold the view that nothing can go wrong with your data when you have the automatic backup system installed on your site. However, you do not know how and when things may go wrong.

So always try to put an extra layer of security around the hard work that takes too much of your time, effort and money. It doesn't even take a minute to lose all your data (human error or technical error) and can be extremely scary to start everything from scratch.

The best way to protect your data is to create a manual backup of your WordPress database over time. It may sound overwhelming in the first place, but trust me, it's worth every second you'll spend in the process.

This backup can be useful in case your site is hacked and you find yourself locked out of the admin area. Since accessing the admin area at such times can be a significant challenge, using the plugin for your backup is absolutely no problem.

In today's tutorial, let me tell you how to run your WordPress database backup without a plugin. But before that, please understand the basics of WordPress database.

Understand the WordPress database

WordPress is a PHP web application database. Therefore, you must backup the following individually to have a complete backup of your database.

  • Your WordPress blog
  • Your WordPress file
  • WordPress MySQL database
  • Original configuration file

Your WordPress blog will contain all the content you have uploaded so far in your website. WordPress files contain WordPress web application files, plugin files, and theme files.

In the third part, you will have more sensitive information such as user information, passwords, content, WordPress plugins and theme settings, website settings, etc.

In the final section, you will back up various original configuration files such as Thethe's .htaccess server configuration file, Webmaster tool identification file like googleCODE.html, BingSiteAuth.html, Wp-config.php, etc.

Know the WordPress file wp-config.php

WordPress wp-config.php is an important part of your website. Not only does it contain database connection details, but it also contains some other important information such as debugging options, WordPress security keys and other similar data. The standard database contains 11 tables. These tables are as follows -

  • wp_commentmeta
  • wp_comments
  • wp_links
  • wp_options
  • wp_postmeta
  • wp_posts
  • wp_terms
  • wp_term_relationships
  • wp_term_taxonomy
  • wp_usermeta
  • user

Different backup ways without plugins

There are several ways to back up your database without plugins. In this post, we will look at three different ways you can use your site. They are -

  1. Schedule automatic backups with cPanel
  2. Create manual backups using cPanel
  3. Create a manual backup using phpMyAdmin

1. Schedule automatic backups with cPanel

Most shared hosting providers offer cPanel where you can schedule automatic backups of your website. This way, you create an automated way to back up your site, so you can skip all the tedious steps to do it yourself.

It will only take you a few minutes to perform the installation. Therefore, you will first have to log into cPanel to find the Cron Job icon.

wp database backup guide

You should see a new screen open with options to allow you to set the time and frequency of running your backup. Order it according to your request. It will look like this.

In the Commands field, copy and paste the following command:

mysqldumpTHERopt -Q -u dbusernameTHERpassword = dbpassword dbname | gzip> /path-to-store-the-backup-file/db_backup.sql.gz

At the location dbpassword, record your database user password. Use a pair of quotes around your dbpassword for it to work correctly.

Instead, dbnamewrite the name of the database you want to back up. You will also have to replace the path file go to backup store by the file path in your server where you want to save the backup.

And that is it. If you want to reassure whether everything has been done correctly, go ahead and check the corn job to see if it works.

Note: You can find the name of your WordPress database in the wp-config.php file, in the WordPress root directory.

2. Create manual backups using cPanel

To create a manual backup of your database, you will first have to log into the web server control panel and select the Backup Wizard option in File.

wp database backup guide

In the Backup Wizard, you will find another backup option. In this section, you will see two different options for backups. With one, you can have a complete backup of your database while the other allows you to perform partial backups.

You may think it is possible to perform a full backup, but there is a small problem with it. If you have a full backup, you will not be able to restore it while you are in the same server.

This step is useful if you are moving to another server and want to restore your database to the new server.

On the other hand, partial backup allows you to restore your database in the same server. You can use this backup if your site is infected by any foreign threat or collapsed for a variety of reasons.

wp database backup guide

Regardless of what you want to back up, each section will need you to back up four different sections.

  1. The main directories include websites for themes, plugins, and uploads.
  2. The MySQL database that includes the site's settings saves your posts and comments.
  3. The email is forwarded and its configured
  4. Email filter.
wp database backup guide

Go to each option individually and download them. Save them in your PC. You can also keep them safe on your hard drive. Once completed, your data is safe and can then be restored whenever you need it.

3. Create manual backups using phpMyAdmin

Generally, WordPress hosting service providers have installed phpMyAdmin in their control panel. Therefore, users can easily place their hands on the control panel and perform the necessary tasks for maintenance.

To create a manual backup of your WordPress database with phpMyAdmin, you will first have to log in to your cPanel. Now when you go down the page will appear on your screen, you will find various options like Options, Mail, File, Logs, Privacy, etc.

One of these options is the Database option. Under this option is called phpMyAdmin. When clicking this option, a new screen will appear on your window called phpMyAdmin. Now select the WP database option on your left.

A list of tables will appear as part of the database. In the menu bar at the top of the screen, you will see a number of options such as structure, SQL, Search, Query, etc. Look for the Export option and click it. This will allow you to export / backup the database to a file.

You will now have two different options on the screen for exporting the database. One is the Quick option and the other is Custom option as shown in the image below.

wp database backup guide

Custom options give you more control over what you choose to export and what not. So choose custom options. This is a screenshot of what you will get.

wp database backup guide

You will see a list of tables that exist in your WordPress database. You can select all of them or choose what you don't want to be exported. It is generally safe to select all items on the table.

On the image above, you'll find the option to Save the output as a file in the Output section. Check this option and select utf-8 for the File character set. For compression, you can choose compression or decompression options.

Now go to the bottom of the page and select Go. You will now have different options to download your file. Depending on what you choose, you will receive either a compressed or compressed format of your database.

That's it. Your work is done.

Now since you know, some methods for backing up your WordPress database, check how these backups can be restored in an emergency.

Restore MySQL database from backup

Restoring your MySQL database from backup is very simple. You can quickly finish it using phpMyAdmin. So you will first have to login to your cPanel and go to the database section. Now click on the phpMyAdmin icon.

On your left, you will find a Menu with two different options. From there choose the database that you want your backup to be imported.

wp database backup guide

When you select the database, you will be redirected to a new page with the structure of the selected database. Now select the Import option in the menu on the top.

Restore backup

A new page will appear on your screen. Click the browse button and choose what you want to import from your computer. Now click on the Go button to complete the process. Once completed, a confirmation message will appear on the screen stating that the import has completed.

Conclusion

For added security, you should regularly run a backup of your WordPress database. Especially when you update your website with new theme settings or add plugins to add functionality.