It’s important to understand the most fundamental WordPress tasks when running your site. Security, of course, should be one of your primary considerations. Creating a manual WordPress backup should also be in your toolbox. You should use a dedicated backup plugin or online service to automatically back up your website.
However, by knowing how to manually backup your website you’ll get a better understanding on how your website works. Also, the manual approach can save your bacon if you for example can’t access your WordPress dashboard or online service. Accidents happen, so as such, it’s a good method to learn.
This post is going to show you how to manually backup (and restore) your WordPress website. Before this, let’s talk about your WordPress installation under the hood, and why an automated approach is the best.
A quick primer on why you need to backup your WordPress website
For the uninitiated, a WordPress backup is simply copying your site’s files and database from one location to another. There are a few solid reasons why you’d want to make regular backups:
- If your WordPress website is compromised, you can restore it back to the original state.
- You can take a current backup and use it to work on a new design for your site, or implement new functionality. You’d do this through a local development environment, while leaving your live site untouched.
- Hardware, software, and general service failures can cause your data to be wiped including your backups.
- User error is always a possibility, despite your care. It’s often more straightforward to recover data from a backup than to recreate it.
However, using WordPress often means installing plugins to help automate daily tasks. If you’re wondering why this is a better way to backup your site, the next section will explain.
Why a manual backup isn’t usually the best approach
An out-of-the-box WordPress installation – it’s ‘core’ – is pretty bare. This is by design. If you wish to change the look of your site, installing a theme is how you achieve it. If you want to extend your site’s functionality, you’ll install plugins.
While plugins can achieve many things on your site, automating complex tasks is one of the best ways to use them. Backing up your site suits automation for a few reasons:
- You can make sure that the same steps are carried out every time you make a backup.
- You’ll know that the right files and folders are backed up successfully.
- You’re also able to make sure the backup is stored securely, too.
Regardless, you’re likely using plugins for many different WordPress tasks already. However, if your WordPress website is hacked, you won’t have access to WordPress’ usual methods of working with files. Given this, learning how to backup manually is another arrow in your quiver.
How to manually back up your WordPress website
We’ll split the manual backup into two parts: The second will look closer at your database. However, before this, the first part will deal with your themes, plugins, and media. Let’s take a look!
1. Backup your WordPress themes, plugins, files, and media uploads
First off, there are a number of files you’ll need to back up. Fortunately, you don’t need to save all of them, as the WordPress core files can be redownloaded.
Before you begin, you’ll need the following in place:
- Administrator access to your hosting server
- A Secure File Transfer Protocol (SFTP) client, such as FileZilla, along with your FTP credentials.
- The skills necessary to transfer files through SFTP.
Once you have these, log into your site through your SFTP client, and check out your list of files in the www or public_html directory:
If you have more than one site, you’ll find some of your other sites in dedicated folders, although the file structure is the same. Rather than scan all of the files here, you’ll only need to find the following:
- The wp-config.php file from the website’s root directory.
- The wp-content directory.
In a nutshell, the first file contains your site’s specific configuration settings, including the connection string the WordPress application uses to connect to the database. The wp-content folder is where your themes, plugins, and media files live.
The job here is simple: Drag the file and folder to a safe location! Once you’ve done this, the first part is over.
2. Backup your WordPress database
Backing up your database is a bit more complex than your site’s folders and files, mainly because you’ll need to connect to the database server. For this, you’ll also need:
- Administrator access to your hosting account.
- Access to a tool such as phpMyAdmin or Adminer that lets you access your WordPress database using a Graphical User Interface (GUI). Such a tool is often available via your web host’s cPanel or similar.
Once you have these to hand, check out the two different backup methods below. Feel free to gravitate to the option that suits you, as they all reach the same goal.
Using a graphical tool (such as Adminer)
Using a GUI to access your WordPress database makes working with it straightforward, and there are a number of tools available. Your host will often provide either phpMyAdmin or Adminer.
The tool’s location will vary depending on your host, but will usually be clearly labelled as such:
Once you’re in, you’ll find a list or drop-down showing your site’s database somewhere on the left-hand side:
Here, choose the database that corresponds to your website’s name:
Next, click the Export link for the database, and if prompted, go with a custom export. On the Export screen, choose UTF-8 encoding if given the option, and choose a GZIP output option (again if you can):
Finally, click Export and save the file to your computer.
Using your hosting control panel’s functionality
Many users underutilize the functionality found within their hosting control panel. Regardless, you’re able to backup your databases from many hosting administration panels. Many hosts use cPanel, but there are also custom dashboards available.
You’ll have to check with your particular host whether you’re able to manually back up databases. Some offer a clear set of instructions for downloading your database. In contrast, others don’t let you manually download databases unless it’s part of a site-wide manual backup.
In any case, there will be an option to backup your site, clearly marked on your host’s back end. If you’re using cPanel, it’s often the Backup Wizard within the Files section:
From here, you’ll want to click the Back Up button, which will lead onto the Full or Partial Backup section:
Finally, click both the MySQL Databases and Email Forwarders & Filters links, then on the specific links on the next page to download your database and files:
Note that you could also download your Home directory for completeness, but it’s not necessary. Alternatively, you could skip the file backup step from earlier, and download your themes, plugins, and media from here too, if the option is available to you.
How and where to store your manual WordPress backups
Before we look at restoring your WordPress website from a backup, let’s give you a few pointers on storing your backups securely. We’d recommend not to do the following:
- Store the backups on your website’s server, as any issues can wipe the data.
- Save the backups on the computer you use for daily work. You risk deleting the files by mistake, or if the hard disk fails you’ll lose them.
Instead, we follow the ‘rule of three’ – store three copies of the backup in three separate places. One should be in a secure cloud storage solution, and one should be on a removable drive. The third can be in a format of your choosing, but must be kept separate from the other backups.
How to manually restore your WordPress website
The good news is that if you’re in the position where you need to restore your WordPress website, the process is almost a reverse to backing it up. While we’ve covered much of the details throughout this article, it’s worth running over the broad steps you’ll need to take:
- You’ll likely be faced with a ‘blank slate’ in regard to your site. As such, we’d recommend installing a fresh version of WordPress, as this will generate your files, a database, and an associated user.
- Log into your GUI database tool using your new MySQL user credentials.
- Find the database name of your new site from the left-hand directory menu or drop-down.
- Once you’re into your WordPress database, click the Import option.
- Browse to your file and make sure the character encoding is set it UTF-8 if available.
- Click Go, Finish, or Import to start the process.
- Once your database is back up and running, take the wp-content folder and wp-config.php file, and upload them to your server, overwriting the previous folders. Update the database name and credentials if need be.
You’ll likely find the restoration process much easier than the backup, as you’ll have already completed each action the first time around.
However, once you’re done, there are two ‘cleanup’ steps to carry out. First, delete the .SQL backup file from your root server, and set the right permissions on your files, folders, and database.
Site backups are a crucial and fundamental process you should implement. They should always be included in your WordPress security program. A manual approach to backups can help you when you can’t access your dashboard.
What’s more, you can learn a lot about your installation from making a manual WordPress backup. So while you should use a plugin or online service to backup your website, do the occasional manual backup.
This post has outlined a number of aspects of manually backing up your WordPress site. You’ll need to consider backing up your themes, plugins, media, and database. For the latter, there are a few methods you can use. Of course, securely storing your backups and knowing how to manually restore them should also be key concerns for you.
The post How to manually backup your WordPress website without a plugin appeared first on WP White Security.
*** This is a Security Bloggers Network syndicated blog from WP White Security authored by Tom Rankin. Read the original post at: https://www.wpwhitesecurity.com/manual-wordpress-backup-without-plugin/