Keeping a healthy backup of your site is essential. Hence it is recommended to ever webmasters to maintain a proper backup of the website owned by the webmaster. Backups are usually done to ensure that if something went wrong with the WordPress site or its data, it can be recovered adequately without loss and time delay. In this chapter, you will learn about the most straightforward technique that you can use to backup your WordPress site.

What Is a Backup?

A backup can be defined as a copy of the original site that will help you to restore your original site data and content when anything goes erroneous on your website. Staying on the safe side by backing up your data is advisable.

WordPress websites are created on two different parts - the themes, plugins, and media part, and the other is the database part that keeps all the posts, blog contents, and comments associated with the posts and pages. Without these two types of files, it is not possible to have a proper website, and hence backing up both these files is essential. Backup is done explicitly in case any menace occurs on your site like data loss, external attack, server down, hacking (DoS, DDoS), etc.

Backup Root Files of WordPress

There are a lot of files that are associated with your WordPress directory. Some of the data can be downloaded back from the site. But, some of them cannot. Such files are:

  1. The wp-content directory contains themes, plugins, including all your media files such as images, audio, or video files that have been uploaded to your site.
  2. The wp-config.php file has database configuration information as well as other required options that make it an important file.

Both the files mentioned above cannot be replaced by any other default file, and hence backup of such data is essential.

Backup WordPress Manually

WordPress is based on PHP and MySQL. In this case, you have to back up your files and its associated database SQL file to have a complete copy of your site; The most direct way to copy your files is through FTP. For implementing this manual approach, the instructions are written below.

First of all, make sure you have saved all your files as well as folders in the directory where WordPress is installed or kept, i.e. within public_html if it is the main application folder of your account.

Now, the backup of the WordPress database can be taken like any other database. The WordPress wp-config.php file will contain the database connectivity details as well as other configuration parameters, like the WordPress security keys, debugging options, and much more. It is also possible to work without backup as the file is because you can forever retrieve the database connection particulars from another source, but it is easy and secure to back it up. In case you have numerous MySQL databases, and you doubt which among the many is used by your site, in that case, you can open the "wp-config.php" file residing in the WordPress root folder and can see the name of the database saved next to the DB_NAME option.