Creating your first backup in WordPress


Creating your first backup in WordPress is an important step toward mastering site maintenance for the long haul. Everyone has different reasons for creating a website. Some people want to grow their business, some people want to sell things through the Internet, some people just want to share information and tell stories. But all of these different use cases have one thing in common: without a backup of your critical site data, your website can disappear overnight along with your creativity, effort, time, and growth potential.

What Critical Site Data Requires a Backup?

For WordPress, the critical data you need to backup consists of:

  1. Core WordPress files (the files at the document root of the website, including media)
  2. The database

The core files are easy to capture. You can use FTP, scp, rsync, or a whole host of other file transfer systems to get a local copy of those files downloaded. The database requires a few more steps, but we will discuss those in detail below. For now, just understand that these two types of backups together make one complete WordPress backup.

Storage Locations – “How many backups do I need?”

Once you have a local copy of your files and database you can send additional copies wherever you need them. Most IT professionals would recommend you have a local backup on your computer for quick recovery (if necessary), redundant backups on an external hard drive, and additional redundant backups in some sort of remote server or cloud storage provider.

But all things considered, the right amount of backups you require depends on your comfort level. However many backups will afford you some peace of mind, that’s the right amount for you.

Backup Strategies

There are two different pathways you can take toward developing a backup strategy. Deciding on backup methods and frequencies is a strategy and a system. It’s strategic because there are many ways to do the same thing, and you want to pick the one that’s best for you. And it’s a system because you will design it once and adhere to it consistently to get the best results. So which strategy and system is right for you?

Backup Plugins For WordPress (Pros and Cons)

There are many different backup plugins on the WordPress market that simplify the whole backup procedure. At the end of day, it comes down to budget. While many of these plugins are free, they offer tantalizing premium services. For example, a “freemium” service level may provide your core files and database bundled into one downloadable archived file, but the premium option may store the backup for you in the cloud. So is it worth the extra money when you can store a backup yourself? If you have the money, and hope to find a set-it-and-forget-it solution, then backup plugins are a great option.

Manual Backups and Automation

With a little effort, you can develop a free backup strategy that affords you everything a paid service would.

FTP and PhpMyAdmin

For simplicity and backup integrity, the easiest and most reliable path you can take involves two easy steps:

  1. Download your core files via FTP
    • Your hosting provider can easily assist you with the first backup if you’ve never used FTP before
  2. Log into PhpMyAdmin to export your database
    • Again, your hosting provider can assist you with this option

With your core files and database downloaded, just drag and drop those files into a new folder, label the folder with the date, and that’s your first WordPress backup.

Scripting Options

For users who are more comfortable with the command line, there are many different options available when it comes to scripting a backup via Bash, Zsh, or WP-CLI. But in theory, the basic backup procedure is the same. You need a command to grab the database and a separate command to snatch the core files (which can include the database file as well). But on the command line multiple commands can be easily chained together.

For example, you could chain together a command using WP-CLI to dump the database into the document root of the website: wp db export. Then, using rsync or scp, you could securely copy the whole document root of the website (which will include the database file) to a remote server. The whole command would only require a few lines of code.

What’s Next?

With your first WordPress backup safely in hand, you can decide how frequently you wish to run through the procedure. For some websites, a monthly backup is perfect. Other websites, particularly e-commerce sites that maintain critical customer data, may require more frequent backups. Your backup frequency will depend on your needs, server peak times, and personal comfort level.