Taking backups of sites is almost an everyday task for bloggers and webmasters. You don’t know when your site will face security threat. It may crash anytime, due to hacks, server issues, or any other problems. And having a complete backup of your site, including files, databases will save you from losing years of hard work you’ve put into your site.
What if I told you that you can create a complete backup of your site for free?
In this article, I’ll show you both way – how to take a backup of your site manually using FTP and using a plugin called BackWPup. After that, I’ll also show you how to restore blog with the backup.
Recommended Reading: Migrate from Blogger to WordPress without Losing Traffic
How to backup WordPress blog and reinstall blog from backup?
Before I show you the step-by-step guide to backing up WordPress blog and restoring it again, let me show you how my blog looks like before I touch on it.
This is the look of my blog as of now.
Before you take a backup of the files, you also need to backup your database and XML file. So, I’ll first show you these two and then move onto the file backups later in the article.
How to backup database manually?
Log in to cPanel. Scroll down to DataBases, click on “phpMyAdmin”.
Select the database you want to backup. I have blurred out my database name for security reasons, but you can see your database name there as shown in the screenshot above.
Now, click “Export” and select the format you want to export in, preferably SQL format and next click “Go”.
A file with your database name as the file name with .sql extension will be downloaded to your computer. Browse to the folder where it has been downloaded and keep it safe, as you will need it later when restoring the blog again.
Now, you can log out of cPanel.
How to backup for XML file?
Log in to your WP Admin Dashboard. Go to Tools in the left navigation and click on “Export”.
Select “All Content” and then “Download Export File”.
An XML file is downloaded into your computer. Save it in a folder properly.
So, you’re ready with the database and XML file. Now I’ll show you one by one both the methods – first using a plugin called BackWPup to create a backup of your blog, and second doing it manually using FTP.
Please note that if you use BackWPup, you can avoid following the above two steps depending upon the configuration you set up for the plugin after installing it.
How to Create Backup using BackWPUp Plugin?
Install and activate BackWPup plugin in your blog. Upon activation, you will see a welcome page.
Now, you need to set up a task for allowing the plugin to take backups of your blog automatically. Click on “Add New Job” to create automated backup jobs.
Now, here you have to do the settings for the type of backup you want to take. Under the General Tab, first you need to give a name to this job. For example, as you can see above, I have named this “PCW Complete Backup”, since I want this particular job to take a complete backup of my blog.
Now, I will check the tasks that I want to plugin to conduct. Here I have selected Database Backup, File Backup, WordPress XML Export, Installed Plugins List because I want the plugin to automate the full thing without having to put my hand into it. So, the database will be backed up, the XML file will be backed up, the files will be backed up and also a list of plugins I am using on the blog will be backed up, if I ever forget about the plugins I had installed here.
Next, choose an archive format you want the files to be downloaded in. By default, it’s Tar GZip, but you can choose Zip format, if you feel.
Now, below that, select the destination where you want your files stored. Here I have chosen dropbox as the destination where I want my files saved. Sometimes, due to security issues, I don’t prefer DropBox, but I prefer files sent via email. However, it is not recommended to backup to a folder in your server, because it causes in increased disk space usage unnecessarily. Finally, save all the changes you made.
Next, under the “Schedule” Tab, you can choose how often you want to backup your blog. You can choose to do it manually as per your need or run a cron job to do it weekly, monthly, or daily automatically for you. For beginners, it is recommended to schedule weekly backups. For example, in the screenshot above, I have chosen to perform the backup every Sunday at 3 hours, means 3 am.
Next, hop to the “DB Backup” tab and select the database tables you want to backup. Sometimes, WordPress plugins create tables into your database and these tables might not be important. So, unchecking these tables might reduce the backup size. However, if you are unsure of what you are doing, then keep all tables checked.
Under the “Files” tab, you can check the files you want to backup. Since I am attempting to take complete backup in this article, I will check all the files, including the WordPress core files. I have checked all but excluded only the BackWPup temp and logs files from the Backup Uploads Folder. In the “Exclude files/folders from backups, I have given these extensions .tmp,.svn,.git,desktop.ini,.DS_Store because I don’t want to backup these files. I have also checked the Include Special Files, as I want to backup everything from wp-config, robots.txt, .htaccess, .htpasswd, favicon.ico from root.
To export the XML automatically, click on “XML Export” and select “All content”, write a name of the file you want to export your XML file and select an extension you want to download in. I prefer keeping it to none, as I want the file to be downloaded as XML file only.
Since I have selected Email as one of the ways to backup files, go to “Email” and type the email address you want the plugin to send you the backup. Put 0 if your email server allows you unlimited storage, or put the value that you can max receive. Make sure that the value is more than the size of the files you will backup, otherwise you will receive error message.
If you want to use DropBox to store your backups, you have to authenticate the app and allow it access to your DropBox.
Let me tell you that when taking automatic backups, sometimes there might be server overloads and the plugin may have to undergo several retries. So, go to BackWPup > Settings > Jobs and increase the Maximum number of retries for job steps from 3 to 5 and select the “Reduce Server Load” to minimum.
That’s all, the plugin will start backing up your files, folders, databases at the given schedules.
You’re worry-free! No hassles of losing all your hard work because you know you have backup of your blog.
You can create multiple jobs likewise separately for backup of database only every day or backup of all files once a month, according to your requirement.
How to backup your blog manually using FTP?
To take up using FTP, you need FTP clients like FileZilla or CoreFTP. These are open-source software, so you can download them here and here respectively for free. I will use FileZilla to explain this article.
I am assuming you have FileZilla already downloaded and installed on your computer.
Double click on FileZilla to open it. Go to File > Site Manager. Put your Host name. It will be like ftp.yourdomainname.com (replace yourdomainname with Your own Domain Name), Logon Type: Normal, User is the username of your cPanel and Password is the password of your cPanel. Next, click “Connect”
See it shows “Directory Listing Successful” upon successful connection with your server.
Now, create a folder on your desktop where you want to backup your files and folders. For example, in this article, I have created a folder named “Backup of PCW” – this is the folder where I will store my backup.
Now, from the Quadrant 1 as shown in the screenshot, select Desktop and you will get to see in Quadrant 2 all the files and folders that are in your Desktop. From the image above, you can see that the folder “Backup of PCW” I just created in the above step is there.
Now, double click on that folder to navigate into it. You will find the folder empty. This is where all backup files will be stored in the next step. Now, go to Quadrant 4 (the server side) and right-click on the folder public_html to download it.
Depending upon the speed of your internet and the size of the files, it takes some time to download. After the download is complete, you will see the files in the folder you created.
How to restore the backup of your blog?
Since I have taken a full backup of my blog, now I will delete my blog and the database and show you how to re-install the blog again from this backup.
Now, as you can see from the screenshot above that now there no blog exists at pedanticcreativewriting.com. It’s empty.
Now, I will re-install the blog again using the backups I have just taken in the above steps.
Before I upload the files, I need to create the database. So, I login to cPanel again, scroll down to Databases and select MySQL Databases.
You need to know the database name, database user and password of your previously created database. So, browse to the folder where you had backed up the files and find the file wp-config.php”.
Open it with Dreamweaver or Notepad++ and find ‘DB_Name’, DB_USER’ and ‘DB_PASSWORD’ as shown in the image. Copy these and save them in a Notepad file safely because you will need them in the next step. I have blurred the image for security reasons.
Now, after you have selected MySQL Databases in the cPanel, you will be directed to this page. Input the Database name here (the one that you copied and stored in a Notepad file in the previous step), the portion after the underscore.
After you have created the database, you have to assign a user to the database. So, create a user as shown in the image above. Make sure the user has the same name as the one you copied in the Notepad file. Also, give the password. The password must also match the previous password that you copied from wp-config.php file to your Notepad file. After that, click “Add User”.
Now, you have to “Add User to the Database”. So, select the Database Name and the corresponding User and click Add. In the next page, select “All Privileges” and “Make Changes”.
So, with this, you’re done with creating the database and assigning an user to this database.
Now, I’ll upload the backup files via FTP.
Open FileZilla once again, connect to your account by going to File > Site Manager and putting the Host Name, User and Password.
Once connected, browse to the folder where your backups are in and open the folder. As you can see in the screenshot above, all the files and folders exist in the public_html folder. So, I will keep that folder open with all files.
Next, on the server side, double click on public_html to open the folder because this is where you are going to upload all your files.
Now, click CTRL + A to select all the files, right click and then select “Upload”.
After all files are uploaded, go back to your browser and type your domain name. A Welcome page will open up asking you to install WordPress. Type the site title, give your username and password and finally click Install WordPress.
You will be asked to log in. Log in to your Dashboard now and visit your site front end. It looks empty as you can see in the image above.
Navigate to Appearance and activate the on the site previously installed.
I have not yet imported the database, which contains all the content. That’s why it looks like that. I will do that in the next step to get back the old look of my blog.
Now, log in to cPanel again, scroll down to Databases once again and click “phpMyAdmin”.
Here select the database name you created. Next, click on Import tab.
From the “Browse your Computer, browse the SQL file that you saved right in the beginning from the Desktop. Under Format, choose the format you saved in. Here I saved in SQL format, that’s why I kept to SQL and then hit the “Go” button.
Go to Tools > Import > WordPress > Choose File > Browse the XML file from your desktop > Upload File and Import > Import Author and assign posts to the existing author > Check the box Download and Import File Attachments > Submit.
Now, activate the plugins installed and place the widgets where they were. Also, go to Settings > Permalinks and adjust the permalinks according to the previous settings. In some themes, the widgets get placed automatically. But if you are on Genesis, you need to place the widgets again to their respective places to design up the homepage.
That’s done, here you can see my blog again in the same way it started.
So, how do you feel? Was it easy or darn hard to backup your blog and then restore your blog again from the backup?
Recommended Reading: A Debate on Blogger and WordPress
You might face some issues but troubleshooting them and learning these basics all yourself is a must for all bloggers.
Do leave a comment and let me know how easy it was to backup your blog following the instructions and then re-installing it again. I would love hearing from you. Also, please share it with your other blogger friends so that they may also learn doing these basics themselves in the future.