It happened to me one day. After having spent several gruelling hours trying to do a WordPress backup on my site, I was unsuccessful. I had tried every (freely :D) available site backup plugin for WordPress, plugins which had gotten rave reviews. But my efforts were in vain. And the problem wasn’t very clear. So, the first thing I did, was turn to Google for an answer. Seems like the obvious thing to do in such situations. But… nothing seemed to help.
Then, I weighed up my options. One option of course was to use a paid plugin – I tried my luck there, but I was a tad bit skeptical about it working, owing to the fact that none of the free plugins worked. So I chose an alternative option.
I took the help of a developer friend to backup the files manually, using cPanel. And it worked! Phew! And it didn’t even take up much of my time. It’s like I was sitting there trying to change the TV channel with a remote, when the whole time, I could have just walked over and changed the channel myself.
Maybe most of you would find success with a backup plugin for WordPress. But for those of you who find yourself stuck in a similar pickle, here’s what you have to do.
WordPress: Which Files to Backup and Why
Before we begin, here’s a little bit of ‘did you know’, about your WordPress site. Did you know, your WordPress site has files and directories which have been added when you install WordPress, and a database where the site content is stored? If you connect to your website using cPanel (or your preferred FTP client), you should be able to see this directory structure. These directories will be placed under a root directory (often,
WordPress File Structure
Inside this root directory, you should find several
wp- files and directories. The most important file here is
wp-config.php. This file contains important information related to your site, and connects your site to the database. A backup of this must be taken successfully.
Other important files which must be backed up are your
.htaccess file resolves your URL structure, to correctly display content using
xmlrpc.php file is used to remotely access your WP site.
wp‐includes directories contain files which are required to access your dashboard, control administrative information, and core files needed to boot your website. The
wp-content folder contains your plugins, themes and uploads. If you lose this folder, you will have to install your plugins and themes again, and will lose all files in your media library.
Your WordPress database can be accessed directly from cPanel. The database by far contains the most important content, and must be backed up on a regular basis. It contains user information, content on your website, and plugin and theme related data.
Backup Your WordPress Site Using cPanel
Now, to backup your WordPress website, you have to login to cPanel. We’ll first backup all the files and then the database.
WordPress Files Backup
- Go to Files Manager.
- Inside Files Manager, you should be able to see your WP directories and files.
- Select and compress
wp-content, all files which have a
- At this point you will be prompted to provide a location where the compressed file will be saved.
- Rename the name of compress file if you wish to do so.
- Download this compressed file (if you encounter problems while downloading the file, connect using an FTP client, and then download it).
- Upload this file to Dropbox (or any preferred location), and then delete this ZIP from the location it has been compressed to using the cPanel.
WordPress Database Backup
- To backup the WordPress database, go to cPanel again.
- You need to know your site’s database. If you do not know which is the current database of your site, you can head over to Files Manager, and open
wp-config.php. The database name will be present in that file.
- Find phpMyAdmin in cPanel.
- Go to the database and click on Export.
- On the Export settings page, customise the following options:
- Set the backup file type to GZIP (or ZIP).
- Set Max Length of Created Query to
0(so as to avoid truncation of queries).
- Hit Go.
- Upload the file to Dropbox.
So, now that you’ve successfully backed up your WordPress site, these files will come in handy if you have a problem. However, you have to know how to restore these files, when needed.
Restore Your WordPress Site Through cPanel
Before restoring your site, backup your files once again. I’m not kidding! At the very least, backup your database. Then, start from the final step in the backup procedure, and do the exact opposite! It’s simple. Here’s what you have to do:
- Download the files from Dropbox
- Go to cPanel, phpMyAdmin
- Import the database file to the database. To be on the safer side, you can create a new database, import the file, and change the database name in
- Go to Files Manager. Upload and extract the zipped WordPress files and folders (you can also do this using an FTP client).
Although it is recommended to use a WordPress plugin to backup your WordPress site, if you don’t have an option, this method will help you out. It certainly worked for me! Let me know if you have any additional questions or have suggestions for fellow readers in the comments below.