3 Easy Ways On How To Backup A Wordpress Site
You have a terrific wordpress site and there is no backup option by default. It is not a terrible news. Do not wait until your blog in a terrible mess and you realize you have no backup of your blog at that moment. I have good news that in this blog post I will show you how to backup a wordpress site.
Backup your wordpress site is regularly must-to-do list as a blogger. There are a few ways to backup wordpress site that I am going to include in this blog post:
1. Using Plugin.
2. Using VPS Hosting Backup Service.
3. Backup Via Command Line.
How To Backup A Wordpress Site
To have a backup functionality of wordpress site, below are a few options you can choose.
First Option: Using plugin
Using plugin is very common to a wordpress site. You can install it with ease. Regarding selecting a backup plugin for wordpress I think my wp backup plugin from mythemeshop is a good choice. You can download it from their site for free.
Step by step below will guide you how to use the plugin.
1. Download my wp backup plugin from mythemeshop.
2. Upload the plugin to your domain root.
3. Activate the plugin.
4. Configure the plugin.
The following below will demonstrate how to configure the plugin :
a. After you activate the plugin, you have new option inside your wordpress site, it is backing up of your full wordpress site. Click menu My WP Backup to start performing a backup.
b. Click on Perform a backup.
c. Click on add new job.
d. Type the name of the job. For example, my-daily-wp-site.
e. Leave the content option by default.
f. You can do a backup of your wordpress site manually using the free version of this plugin. If you need to do the backup activity automatically, you have to buy the Pro Version.
g. For the destination, you have three option, there are FTP, Dropbox or Google drive. I prefer to use either Dropbox or Google drive as it is free, easy to do and secure. For this example, I am going to use Dropbox as my backup destination. To do this, do the following: click on destination, click on dropbox, get the token from dropbox, place the token in the provided field and click on Connect Dropbox account.
Below is step by step how to get a token from Dropbox :
g.1. Login using valid username and password into www.dropbox.com/developers/apps using your Dropbox account.
g.2. Click on create app.
g.3. You will see three steps, there are choose an API, choose the type of access you need and name your app.
g.4. Check Dropbox API for the first step. Check Dropbox business API if you are using dropbox professional account and above.
g.5. Check full dropbox for the second step.
g.6. Type your app name with the name you like for the third step. Example: my-lovely-app.
g.7. Click on Generate Button to get dropbox token.
h. If you want to have a report of your backup activity, click on report. Again, click on E-Mail.
For the email details, place the appropriate information as per example below.
Sender Address : myemail@gmail.com
Sender Name : myname
Recipient Address : mybackup@gmail.com
Subject : Backup wp site
Body : Job {{name}} finished in {{duration}}
method : default
After you finish with the email details, hit Save Changes.
i. To do a backup, click on Backups. Then press Run a backup job. As soon as possible your backup files will be transported to the selected backup destination.
j. To restore a backup, click on Dashboard. Again, click on restore from a backup. Your backup files will be restored immediately.
If you want to run a backup automatically, you have to buy the premium version. It is cheap for only $29 yearly.
Second Option: Using VPS Hosting Backup Service
A few vps hosting provider such as linode, vultr, digitalocean, etc, provide you with a backup option to backup your entire vps disk. If you perform this kind of backup, you will have a full backup of your wordpress site. This is a good option as you do not need any plugins so less burden your hosting.
Another option is to host your site on vps hosting which having a regular backup on a daily basis. You do not need to back up the entire site. Your hosting provider will do it for you for free. A few hosting has this option such as knwonhost, greengeeks, etc.
If you realize something wrong happen to your site, you can contact your hosting provider. Their customer support will do check your site and its hosting. Their investigation will lead to doing any necessary action to save your site and its hosting. If they can prove that your hosting or your site have been experienced a bad activity such as login ssh without your permission, unknown user access your login site, etc, they will restore your site from the previous backup.
The easiest way is using managed wordpress hosting and the problem is the cost. The cost is $15 monthly at a minimum on average for one wordpress-powered site. A few managed wordpress hosting I am sure are very highly recommended are kinsta, wpengine, flywheel, pagely and more.
Third Option: Backup Via Command Line
You can do a backup via command line if you can access your hosting via ssh. A few hosting providers give you an ability to access ssh with ease even it is shared hosting such as hawkhost, siteground, etc.
Below the step by step guide :
1. Login ssh using the correct user and password.
2. Create a backup directory.
mkdir backup
3. Backup wordpress site files.
sudo tar -cvf /home/username/backup/mybackupsite.tar /path-to-root-of-your-site
4. Backup database.
mysqldump -u username -p password > /home/username/backup/database.sql
5. Upload the backup files to cloud files sharing. I recommend you to use google drive as it is free and easy to use. At first, you must visit the page below.
github.com/prasmussen/gdrive
Then download gdrive binary file. Gdrive is a free tool for accessing google drive via command line.
wget docs.google.com/uc?id=0B3X9GlR6EmbnQ0FtZmJJUXEyRTA&export=download
Rename the downloaded file to gdrive.
mv uc?id=0B3X9GlR6EmbnQ0FtZmJJUXEyRTA& gdrive
6. Run command line below, so that the binary file to be executable.
chmod +x gdrive
7. Configure the software.
./gdrive list
The tool will ask you to place a particular url into your browser so you can get a verification code to have a grant access to google drive via gdrive command line.
8. After the verification is valid and complete, you can start to upload your backup files. Example command line :
./gdrive upload filename
For example, I make a file named hello.txt. Then I upload it to google drive using a command line. Below is the proof that the tool works well.
Wrap Up
After implementing a few methods on how to backup wordpress site, I found myself that it is more comfortable to adopt backup plugin on wordpress site such as my wp backup plugin as it is free, cheap and easy to do. If you want to implement the automatic method, you can purchase the pro version of this backup plugin.
Off course the safest way is you can buy manage wordpress hosting or vps hosting but they cost you more money. However all the ways that I explained here about how to backup your wordpress site are good enough for you to use to back up your wordpres site.
Tags :