Have you ever lost your WordPress site? Perhaps your site got hacked or attacked by a malicious software. Or maybe you installed a faulty theme, plugin or add-on. You might have accidentally locked yourself out. A server fail or any other reason that caused your site to crash. Losing your entire months and even years worth of hard work seems unnerving enough. And the scariest thing is the chances of it happening is very plausible. Having a plan in place to back up your site is absolutely critical for anyone and everyone who has a website – from the rookie techies to experienced lead developers. Trust me, you’ll save yourself from so much heartache.
In this post, we will showing you how to back up a WordPress site manually. There are plugins to do it for you. But let’s do things old-school style for a change. Also, it gives you full control over the process. Before talking more about backing up, a brief introduction to what a back up really is.
I personally had no idea what backups are, let alone the reason to why I should create one. Circumstances forced me to. Then I had accidentally deleted several important files. Just like saving work when you’re writing a paper, or preparing an important report for work, it is important to save copies of your website. As it’s called in the tech world, you always want to have a “backup.”
A backup is, simply, it is a copy of all your work. This includes website theme and related site files like plugins as well as your database like posts, users, comments, etc. You probably are doing this in your other daily activities like saving an important document to Google Drive or Dropbox or to a medium (like external hard drive, “cloud”, etc).
Backup allows you to reinstall (restore) should something goes wrong: a fail-safe, precautionary measure that saves you a lot of undue stress.
BACKING UP IS GREAT BUT MAKE SURE TO PUT SOME PREVENTIVE MEASURES IN PLACE, TOO
Yes, backing up seems like the solution to the possibility of losing your WordPress site but even when you’re safe and implementing all of the right measures, things can always go wrong. Realize, the struggle is real and put prevention measures in practice to keep your site safer and more secure.
- Updating themes and plugins
- Using strong username and password combinations
- Creating strong database table prefixes (i.e. not using basic the common “wp”)
Now let’s get down to business.
Back up a WordPress Site Manually
Your WordPress directory contains sub-folders e.g. wp-content, wp-includes etc and files e.g. wp-config.php, theme and plugin files etc required by your WordPress site. The wp-content folder contains all your themes, plugins, cache and uploads among other things. You cannot afford to lose this data. The wp-admin carries all the files required by your WordPress admin area, so you can’t afford to lose this as well. The wp-includes folder contains WordPress core files. This is the folder where all the major WordPress code lives. You definitely don’t want to lose this code.
Back up Your WordPress Site via cPanel
This is so easy you can do it in the time it takes to brew a mug of coffee. Here’s the procedure:
- Login to your web host and navigate to cPanel. For most web hosts, the cPanel is usually the first page you encounter when you login
- Navigate to the File Manager, which should lead you to your public_html or Home directory
- From here, just locate your WordPress directory. This is the folder you want to back up
- Unfortunately, you can’t download the WordPress folder in File Manager without first compressing it. Worry not though, compressing a folder needn’t be challenging
- Click on your WordPress directory, and select Compress from the menu bar. Alternatively, right-click on the folder and choose Compress from the drop-down options menu that appears
- Choose the compression type e.g. ZIP, Tar, GZIP etc from the dialog box that opens. I always go with a ZIP archive
- Then just hit the Compress File(s) button and wait for the process to run its course. Your server will save your compressed WordPress folder
- Click on the archive you just created and choose Download from the menu. Alternatively, right-click on the archive and choose Download.
- Choose a secure location on your hard disk and save your backup
- And you’re good to go!
If your web host uses a different control panel e.g. vDeck, Plesk, etc, you just need to locate your File Manager, and just follow the process i.e. Locate File Manager > Locate your WordPress directory > Compress > Download. Repeat regularly.
Backing up Your WordPress Files using FTP
FileZilla is lightweight and easy to use. All you have to do is login to your server, locate your WordPress directory, and download the files to your computer. You need a FTP account to use FTP, which should be easy to set up from FTP manager in your cPanel.
Backing up Your WordPress Database
Now that we have a fresh copy of your WordPress files, let’s back up your WordPress database, so we can have a full backup that will come in handy on that proverbial rainy day.
Just navigate to your cPanel and locate phpMyAdmin. It’s usually located under Database Tools:
Log in, which should lead you to the phpMyAdmin administration panel:
Hit the Databases tab to list your databases. If you installed your WordPress site using third-party platforms such as Softaculous or Mojo Marketplace, you might have no idea which database to work with. Same case applies if you have several databases with funny names like mine in the image above. What to do?
From your File Manager, navigate to your WordPress directory and locate the wp-config.php file. Right-click on wp-config.php and choose view:
In the window that opens, you want to locate this line:
Your database name is the value contained in the second set of single quotation marks, which is ‘database_name’ in our example above. Armed with this info, locate your database in phpMyAdmin. Click on the database to open it. You should see something such as:
Select all the tables you’d like to backup by ticking the check boxes. Then, lick Check All at the bottom to select all at once. Once you’ve selected the tables, hit the Export tab. Select the export method, and set format to SQL:
Hit the Go button, and save your database in a secure folder on your PC. Remember to save copies in the same locations you saved copies of your WordPress files. And that’s it, you now have a full backup of your WordPress site.
Using a different setup? If your host doesn’t provide cPanel, please check out this WordPress backup post at the Codex.
SO, HOW OFTEN SHOULD YOU DO A MANUAL BACKUP?
That depends on how frequently you update your site, both in the content and design and functionality of your site.
If you post 50+ posts per day, you need to create backups more regularly than the guy who posts once a month. Other than that, consider checking if your web host offers a reliable backup solution.
SO, HOW MANY BACKUPS SHOULD ONE HAVE?
Even this depends on you and your site.
Upload the backup to your Dropbox account, Google Drive, burn it to a DVD/CD, email it, etc – just make sure you have several copies to ensure you don’t lose your site should one of the backup dies.
But no need to save every back up in history! (That would take up a ton of space on your computer/external hard drive)
You can make more periodic theme-only backups (so, not the database) if you’re redoing your site. Just as a way to double-save your work.
Thence, you should always back up your word. It will take more time and effort but think of the pain, anxiety and working hours you’ll save by keeping a code apocalypse at bay. You can also automate WordPress backups using nifty WordPress backup plugins but it won’t give as much control as manual backups. We will be talking about the plugins in the next article. So make sure you check that out too.
We covered our methods, but how do you backup your WordPress site? Please share with us in the comments.Till then, Happy WordPressing!