How To Backup WordPress Files and Databases
There are few things worse than discovering that an unforeseen error, attack, or failure has caused you to lose hours of hard work creating your WordPress site. If you’re a developer, this may even prevent you from reaching that all-important client deadline.
Fortunately, WordPress makes it easy to back up your WordPress site. You have the option to do so manually via Secure File Transfer Protocol (SFTP) or cPanel, as well as with dedicated WordPress plugins.
In this article, we’ll explore how a WordPress backup works, and why it’s so important. Next, we’ll move on to exploring how you can back up your WordPress site. Let’s dive in!
What Needs to Be Backed Up
When it comes to creating a backup of your website, WordPress recommends that you back up everything. This includes two main components – your site’s files and its database.
The files you’ll back up include associated plugin and theme files, code files, images, and static web pages. When it comes to your database, this is where all your site’s content resides. Backing this up means that if you ever have to restore your website, you’ll still have your posts, links, and comments intact.
Why Are WordPress Backups Important?
Although WordPress is highly secure, this doesn’t mean your site is immune from issues that may cause you to lose content. A WordPress backup is one of those things you’ll be glad you have, but hope you never need.
Backing up your site’s files and database is like creating an insurance policy. It’s something you can cash in as and when you need it. Whether the problem is due to a hack, attack, coding blunder, or something else out of your control, having key elements backed up means you can get your site back online quickly.
Backing up files can also save you time and eliminate frustration. For example, if you make an error while working on your site and can’t find the cause, you can simply restore a recently backed-up version. As such, it’s important to back up your site regularly, using one of the following three methods.
Option 1: Back Up with a Plugin
Backing up your WordPress website with a plugin is the most feasible option for most users. There are several free plugins available that can help you do that. To give you an example of how this works, we’ll use the UpdraftPlus WordPress Backup Plugin:
Once you’ve installed and activated the plugin, you’ll be prompted to go through several setup steps:
Making a backup with UpdraftPlus is pretty simple. Right away, you can select Backup Now on the Settings page and create your first backup:
Additionally, you can use the tabs in the Settings to create automated backups, and connect to many different cloud storage options to save your backup files:
It’s as easy as that! Using a plugin can save you a lot of time, and build in an extra sense of security. You’ll have a ‘Plan B’ in place if your site crashes, is hacked, or has an unrecoverable issue. Additionally, one of the best benefits of this particular plugin is that you can also restore your site easily if needed.
WordPress Backup Plugins
Using a dedicated WordPress backup plugin presents the simplest way to ensure that your site can be restored. There are a variety of free options to consider, most of which are lightweight, intuitive, and well documented.
We’ve previously written an entire article on WordPress backup plugins, where we explored the best solutions and how to use them. For the purposes of this article, we’ll focus more on the manual methods for backing up your WordPress site.
Jetpack offers always-on security for WordPress websites which includes real-time backups and malware scanning. The backup solution saves every change you make to your website and offers one-click restores. You can restore your site with the WordPress mobile app. The plugin also notifies you if your site goes down.
Pros: Real-time backups, one-click restores, and an activity log to understand what went wrong.
Cons: Daily backups solution creates a 30-day backup archive and log of site changes.
Price: Pricing starts at $7.95/month billed yearly for daily backups. Real-time backups start at $39.95/month billed yearly.
Like VaultPress, BlogVault automatically backs up files. It does this on a daily basis and even allows data to be exported directly to Dropbox. Restorations are automatic and backups are in offsite data centers. This WordPress plugin to backup a database even include archives so users can pull up previous versions.
Pros: Each backup has its own mini-menu that allows users to easily choose what is done with that specific backup. Platform also shows timestamps for previous and upcoming backups.
Cons: The basic package comes with no security, and it’s a bit pricier than other similar options.
Price: With BlogVault there’s a free 7-day trial, but their package pricing starts at $89/year.
Rather than backing up your site on a fixed schedule, CodeGuard continually monitors your site and only performs a backup when it recognizes that changes have been made. This, combined with pain-free restoration makes it one of the most efficient WordPress backup solutions available, if not necessarily the most cost-effective.
Pros: CodeGuard can work with other platforms outside of WordPress. It’s also essentially always on “autopilot.”
Cons: Pricing can turn expensive when operating numerous sites.
Price: Pricing starts at $60/year for one site. For $468/year, you can use it to backup 12 sites.
When it comes to free WordPress backup plugins, UpdraftPlus might be the best option. In the free version, users can set up their own automatic backup schedule. Storage options include Google Drive, Dropbox, personal computers, and even web hosts. Additionally, database and file backups can be scheduled separately, and multiple archives can be utilized for increased reliability. Premium versions add all available add-ons as well as 1GB of storage on UpdraftVault, their own storage product.
Pros: Easy customization offers and competitive pricing come standard. The basic interface is also easy to use.
Cons: Option for lifetime updates is unavailable. Advanced configurations can also be difficult to master.
Price: Basic version is free, but premium can range from $70-$145.
BackWPup’s free version offers some of the best capabilities relative to other free options. This tool allows for backups to be stored in Dropbox and other external drives, but users can also download backups as a .zip file and simply import the file later to restore the site. Automatic phpMyAdmin backups are also provided, so it’s easy to work with the database.
Pros: Provides a simple user interface. File and database backups can be scheduled separately, and the platform has various backup location options.
Cons: Backups must be scheduled – can’t be on-demand. No migration or cloning tools provided. Restore capability isn’t integrated in Pro version – it only works as standalone app.
Price: Free version available. Prices range from Standard for $69/year to Agency for $349/year.
Option 2: Back Up WordPress Manually
Although plugins present a quicker method for backing up your site, it’s important to know how to complete the process manually. After all, a plugin may malfunction, or an issue may arise that prevents you from accessing your site’s dashboard.
While most backup plugins are light, opting for the manual method is also ideal if you’re concerned about the performance impact of adding another plugin to your website. With that in mind, let’s start by looking at how you can back up your site with SFTP.
Back Up WordPress Files Using the SFTP Method
For this example, we’ll be using the SFTP solution FileZilla. This is a free, open-source, and powerful tool. Once you’ve installed and opened the application, you’ll need to enter your SFTP credentials into the fields at the top of the screen – Host, Username, and Password:
These credentials are usually found within your account’s hosting panel, although you should contact your host’s support channels if you can’t find them.
Once you’re logged in, you’ll need to create a local folder where your WordPress backup will be stored. You can do this within FileZilla or directly on your computer, whichever is easier.
Back in FileZilla, navigate to the right-hand quadrant, and select the public_html folder. This contains the entire contents of your site, and can also be called www, root, or even be named after your site.
The next step is simple. Drag the public_html folder across FileZilla and into your local backup folder, from the right-hand quadrant to the left-hand one:
FileZilla will then take a few moments to copy over the files, at which point your site will be completely backed up.
Back Up WordPress Files Using the cPanel Method
cPanel is a control panel used by many web hosts, which can be used to securely manage and back up your WordPress site via a simple interface. This backup process is the most convoluted of all the common methods, although it’s still simple enough to achieve.
First, log into your hosting account’s back end. Within cPanel, navigate to the File Manager:
Next, click on (but don’t enter) the public_html folder, and select Compress from the toolbar:
You’ll be presented with a dialog box asking you to choose a compression format and name your file. Select Zip Archive, and click on Compress File(s):
Finally, select the ZIP file within File Manager, and click on Download from the toolbar. This will download the file to your computer, at which point you should delete the copy on your server.
Back Up the WordPress Database Using phpMyAdmin
The previous step only covers one aspect of manually backing up your website via cPanel. You’ve copied over your site’s files, but its database is just as important. To make sure that too is preserved, head back to your cPanel dashboard and navigate to phpMyAdmin:
Inside, you’ll see a list of your websites within the left-hand directory. Click on your website’s database, check all the ‘tables’ within, and then navigate to the Export tab:
While there are a few options within this screen, choosing a Quick Export method and the SQL format will suffice. When you’re ready, hit Go:
Your file should now download. If the backup displays directly within phpMyAdmin, simply copy the contents into a new text file using your favorite text editor, and save the file using the .sql extension.
Option 3: Back Up Through Your Hosting Provider
In order to make the manual backup process easier, many hosts offer a built-in solution. At WP Engine, we make it easy to back up your site as and when you want to. To give you further peace of mind, every plan includes automatic daily backups as well.
- Log into your dashboard and select your account from the Installs menu.
- Select Backup points from the dashboard menu, and then Backup Now.
- After you’ve entered a description for your backup, click on Create production backup. Your backed-up site will then be accessible in the Backup Now screen.
That’s all there is to it – peace of mind in three simple steps!
How Often Should WordPress Sites Be Backed Up?
Deciding how often to create backups of your website’s files and database depends a lot on how often you add new content. If you make changes, install new plugins, or add posts or pages on a daily basis, your backups should take place more frequently than they would on a relatively static site. A good rule of thumb is to create at least one backup each day.
Also, no matter how often you decide to schedule your site’s file and database backups, there is an important exception to keep in mind. It’s recommended that you create a full backup before making any major changes to your site. This is to avoid unintentional errors or corruptions, and applies to installing new versions of WordPress as well.
Where Are WordPress Backups Stored?
Where your WordPress backups are stored depends on your method of creating them. For example, if you manually downloaded your files and database from cPanel and phpMyAdmin, then your backup should be saved to your computer’s hard drive.
If you use a tool like UpdraftPlus, your backup will be stored in the cloud option you chose during the plugin’s setup process (for example, Google Drive or DropBox). If you did not choose a cloud option or are using a different plugin, your backup files are typically stored within your existing WordPress database and file system.
If you need to restore a backup because your website was hacked, restoring files that are stored in the hacked database may not be the best option. So it’s vital that whatever your backup solution might be, you keep multiple copies of your backups stored in external locations.
Automatically Back Up Your WordPress Site with WP Engine
With WP Engine, you can rest easy knowing that your site is backed up nightly. This means you can restore previous versions of your WordPress site whenever the need arises. Plus, if you have any questions or concerns about backups (or any other aspect of your WordPress site) our reliable support staff are available to help 24/7.