How To Backup WordPress Files and Databases

backup wordpress

There are few things worse than discovering that an unforeseen error, attack, or site 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 backup 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 backup your WordPress site. Let’s dive in!

Why Backup WordPress Files?

Although WordPress is highly secure, this doesn’t mean your site is immune from issues that may cause you to lose your content. Failing to backup your files will mean in the event of a server outage, hack attack, or system error you could lose them all.

In addition to helping you avoid catastrophe, 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 source, you can simply restore a recently backed-up version of your site. As such, it’s important to backup your site regularly.

WordPress Backup Plugins

Using a dedicated WordPress backup plugin presents the simplest way to ensure 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 this article, we’ll focus more on the manual methods for backing up your WordPress site.

How to Manually Backup WordPress

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 admin panel.

While most backup plugins are light, opting for the manual method is also ideal if you’re concerned about the site performance impact of adding another plugin to your site.

Let’s start by looking at how you can backup your site with SFTP.

The SFTP Method

For this example, we’ll be using the SFTP solution FileZilla, as it’s free, open-source, and powerful. Once you’ve installed and opened the application, you’ll need to enter your credentials into the fields at the top of the screen – Host, Username, Password, and Port:

SFTP to back up wordpress site

They’re usually found within your account’s hosting panel, although you should contact your support channels if you can’t find them.

Once you’re logged in, you’ll need to create a local folder in which your WordPress backup will be stored. You could do this within FileZilla or directly on your computer, whichever is easier.

Back in FileZilla, navigate to the right-hand quadrant, and select to highlight the public_html folder. This is essentially the entire contents of your site, and could also be called www, root, or even named after your site.

The process now is simple: drag the public_html folder across FileZilla, and into your local backup folder, from the right-hand quadrant to the left:

Wordpress backup with sftp

FileZilla will then take a few moments to copy over the files, at which point your sites will be completely backed up.

The cPanel Method

cPanel is a control panel used by myriad web hosts that can be used to securely manage and backup your WordPress site via a simple interface. The backup process is the most convoluted of all methods, though it’s still simple to achieve.

First, log into your hosting account’s back end, and within cPanel, navigate to the File Manager:

cpanel method to backup wordpress site

Next, click (but don’t enter) the public_html folder, and select Compress from the toolbar:

cPanel wordpress backup

You’ll be presented with a dialog box asking you to choose a compression format and to name your file. Select Zip Archive, and click Compress File(s):

wordpress site backup with cPanel method

Finally, select the ZIP file within File Manager, and click Download from the toolbar. This will download the file to your computer, at which point you should delete the file from your server.

However, this is only one aspect of manually backing up via cPanel. Your database is just as important. To back it up, head back to your cPanel dashboard, and navigate to phpMyAdmin:

how to backup wordpress site

Inside, you’ll see a list of your websites within the left-hand tree directory. Click your website’s database, Check All ‘tables’ within, then navigate to the Export tab:

wordpress cPanel backup steps

While there are a few options within this screen, choosing a Quick Export method, and the SQL format is suffice. When you’re ready, click Go:

wordpress site backup

Your file should now download, but if the backup displays directly within phpMyAdmin, simply copy the contents into a new text file using your favorite editor, and save it using the .sql extension.

How to Backup Through Your Hosting Provider

In order to make the manual backup process easier, many hosts offer a built-in option. At WP Engine, we make it easy to backup your site as and when you want to. To give you further peace of mind, we even offer a free automatic daily-backup service.

To backup your WordPress site with WP Engine:

  1. Log into your dashboard and select your account from the Installs menu.
  2. Select Backup points from the dashboard menu, then Backup Now.
  3. After you’ve entered a description for your backup, click 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!

WordPress Backups and Hosting Reliability

With WP Engine, you can rest easy knowing you can easily backup and restore previous versions of your WordPress site as and when you need to. If you have any questions or concerns about backups, or any other aspect of your WordPress site, our reliable support staff are also available to help 24/7.

To find out more about our digital experience solutions, or discover how we can help your WordPress site better meet your objectives, contact us today!

Get started.

Build faster, protect your brand, and grow your business with a WordPress platform built to power remarkable online experiences.