Keeping a backup of your WordPress site is very important to prevent your hard work from vanishing in an instant. Unforeseen events can trigger unexpected crashes and data loss that can destroy everything that you’ve worked so hard for. With that in mind, you really should start backing up your site to save yourself from one of the biggest nightmares a website owner can have. Let’s begin!
WordPress installations are divided into two parts. The first part is the files, which includes the scripts, CSS, PHP, HTML as well as the multimedia files like images and videos and other files added in your WordPress installation directory – basically everything inside the WordPress install directory. The second part is the database, which contains the posts, comments, links, and other items you have on your website. These are the things you need to backup.
There are several ways to backup your WordPress website. There are manual and automated solutions and there are tons of plugins available out there that you can use to schedule your backup. The next section will cover how to backup your website manually. If you’re interested in easier ways, skip to automated backup solutions.
Manually backing up is quite complicated and off-putting for beginners, but this ensures that you do not miss anything. Also, once you know how it works, it’s actually quite easy. There are two parts in manually backing up your WordPress installation. First are the files and then the database.
Backing up your files
Backing up your files should be fairly easy. All you need to do is to download your entire WordPress install directory. This will contain subfolders such as the “wp-content,” “wp-includes,” “wp-admin,” and others, along with PHP, HTML, CSS, and other files. Below is an example document structure of a typical WordPress installation:
Everything you can find in this directory should be backed up (of course yours will look different, but download everything inside this directory to make sure you didn’t miss anything). In order to do that, you can use an FTP client to download all the necessary files from your server. Once you’ve downloaded the files, you can zip them to reduce the file size.
Backing up your database
There are several server software packages that can help you manage your database, but the most popular one is called phpMyAdmin. The following steps will help you create a backup of your WordPress database using phpMyAdmin.
1. Login to phpMyAdmin. You can use the cPanel to do this. Just login to cPanel, find phpMyAdmin, click it, and you should be automatically logged in. If you can’t find it, contact your host.
2. Once logged in, you will be able to see the list of active databases in your server on the right side.
3. Select your WordPress website’s database. In the example above it’s very obvious, but if you are doing it in an actual live website, your database will be named differently and is most likely sitting along with dozens of other databases. If you don’t know which one is the database for your site, you can do the following trick: open your wp-config.php file and find the line where it says something similar to the image below. The indicated name after the “DB_NAME” should be your WordPress’s database name. You can also find the database password just under the database name. You can use this to login to phpMyAdmin.
4. Once you know the name of your database, it’s time to back it up. Click on your database to open it. Then scroll down to the bottom and check the box “check all” and from the drop-down menu beside it, choose “export.” Refer to the image below.
5. After that, you’ll be redirected to another screen. Choose “custom” as the export method.
6. Scroll down and make sure you check the “Add DROP TABLE / VIEW / PROCEDURE / FUNCTION” and “IF NOT EXISTS” options.
7. Now you’re ready to create your database backup. Once you hit go, your database will be backed up and automatically be downloaded to your hard disk. Depending on the size of your database, it may take a while to finish.
That’s it! You’ve just made a backup of your database that contains all your posts, links, comments, settings, authors, and other important data. Now you have a complete backup of your WordPress website, ready to be restored at any time!
If you followed the above instruction for backing up your site manually, then there will come a time when you have to restore WordPress from backup. First, you need to restore your files.
To restore your files, all you need to do is to delete all of your current WordPress files. To do that, login to your cPanel, and go to the File Manager. Navigate to your WordPress install directory and delete everything. After that, open up your FTP software and upload your files back to the empty directory.
After you’ve reuploaded your backup files, it’s time to restore your database. To restore your database:
1. Login to phpMyAdmin.
2. Click your WordPress database to open it.
3. Once you have your WordPress database open, you will now be able to manipulate it.
4. From the menu, there is an Import option which will allow you to upload your database backup.
5. Upload your backup database and hit go.
6. Once finished, you should see a message saying that the import succeeded.
And that’s it! You’ve successfully restored your WordPress site. To ensure that you always have the latest backup, download a copy of your files and database at regular intervals.
Manual backups give you a total control over which files are backed up and ensures that you have the correct and complete backup of your files and database to the best of your knowledge. However, sometimes it can be a hassle to manually repeat it frequently, especially if you are managing multiple sites. Good thing there are automated backup solutions available – not just for WordPress sites, but for any kind of website!
Backing up WordPress Using Softaculous
To create a backup using Softaculous, login to your cPanel and find the Softaculous link. Click it and you should be automatically redirected to the Softaculous panel.
Once you’re there, click WordPress and you should see all of your active WordPress installations.
Click the folder icon to create a backup. In the backup page, be sure to check backup directory and backup database. You can also add a note if you want.
Scroll down to the bottom and click Backup Installation. After that, your site will start backing up. Once done, you will be notified with a success message as well as the place to find the backup file. From there, you can either download the file or perform a restoration.
Restoring WordPress using Softaculous Backups
To restore your WordPress from a backup, access the “Backups and Restore” page of Softaculous. If you can’t find it, refer to the image below.
From there, you’ll be taken to a page which lists all of your current backups. Click the restore button and you’ll be able to choose whether you want to restore both files and the database or just one of them. From there, just watch the magic happen.
Automating Softaculous Backups
To create automated backup solutions, login to Softaculous and click WordPress, you can see all of your active WordPress installs. Click the pencil icon beside the website you wish to create automated backups for.
You will be taken to the “Edit Installation Details” page. Scroll down until you find the backup options.
From there, you can choose the backup location, the frequency, and the number of backup files to keep. Choose your preferred settings and hit “Save Installation Details”. Now, you have an automated backup solution for your WordPress site! To restore a backup, just follow the restoration instruction for Softaculous above.
There are a number of WordPress backup and restore plugins to choose from when looking for automated WordPress backup solutions. They offer the same features found in Softaculous, but they have more additional ones like saving a backup to an external location or migrating your backup to another host or even domain. Each plugin has a different way of doing things, so you need to consult the plugin’s documentation.
So, what’s the best way to backup and restore your WordPress site? It depends on your preferences. In general, however, it’s good to have an automated solution to make sure that you have the latest database and file backups. This way, you minimize the risk of losing too much data.