My recent post on self hosted server migration tips had a mention of the many tasks that comes with moving to a self hosted server. One of the very crucial and important ones, is managing the backup of your WordPress site. Having a backup increases your web security and gives you peace of mind that all your hard work is safe from hackers . There is always an option of reverting back to a working version of the backed up files even in case of accidental deletion or corruption from plugin installation or incompatibility.It is therefore wise to have a backup periodically , when any changes are made and especially before a new version of WordPress or plugin is installed or upgraded.
Thankfully there are many free and paid plugins that offer backup and security and work well for many.The popular ones in no particular order are Backupbuddy , UpdraftPlus, Vaultpress (with JetPack), BackWpUp, BackUpWordpress, WP-DB-Backup,Duplicator.To decide on which plugin best works for you, check for the following factors:
- the ability to automate backups
- the ability for partial or full backups
- frequency of backups
- location of data storage
- ease of restoration
There is also the manual process of backing up your WordPress site which is fairly simple. This may not be the best or the most economical way , but works and is definitely a good learning process .There is also a sense of being in control of what you are doing .This full manual backup mainly involves two steps:
- Backing up your WordPress files and folders.
- Backing up your My-SQL database.
To backup WordPress files and folders :
- Login to your hosting account (Siteground in my case) and navigate to My accounts and cPanel.
- Scroll down to the Files section and find the folder File Manager and double click to open it.
- From the pop-up ,click on the radio button “Document root for” , the root directory (public_html) opens up with all the files and folders.
- Select all the files in the root directory by highlighting them and click on the Compress button in the top menu.
- Choose Zip as the compression and choose destination as the same location .You can rename the zip to a format like mmddyy-sitebackup.zip for easy reference later.
- This may take a while to be created. Once done, download by highlighting on the zip and clicking on Download button on the top menu.Alternatively , you can use a FTP client like Filezilla to transfer the files to your local machine.
- Once the file is downloaded locally and saved, do remember to delete it from the location it is created using cPanel to save space and also for security reasons.
- Keep this file in a secure place or in multiple locations like google drive or dropbox.
To backup My-SQL database :
- From the cPanel find PHPMyAdmin folder and click on it.
- An interface pops up with a list of databases.
- Select your database .If you are not sure of your database name, you can it figure from the wp-config.php file found in the root directory. There should be an entry in the file with line define(‘DB_NAME’, ‘database_name_here’);
- Click on the database and check all , check on the Quick-display for export method option in the radio button, choose SQL for format ,and click on Export tab in the top menu . Click on the go button.
- A SQL file is downloaded to your desktop .
- Keep this file in a secure place or in multiple locations like google drive, Dropbox .
I found this video from WPlearningLab.com very useful .It shows step by step instructions on how to manually backup your wordpress site using Hostgator .However it should be similar for any web hosting sites.
How to Restore your backup ?You can restore your website from the two files that you previously backed up
- Log into your hosting cPanel account and navigate to Files and File manager.
- Open the document root eg. public_html.
- Delete any content there.
- FTP or copy the wordpress file that you backed up first .
- Highlight the file and click on Extract.
- From the cPanel go to PHPMyAdmin app and locate your database.
- Delete all the files under it.
- Click on Import tab on the top menu . Click on the browse button to find your sql file that you backed up.
- Click on open and click on the Go button, the database is restored.
- Reload your site and all the contents should be back up !
This video has details of how to restore your wordpress site from backed up site.
If you are not in favor of manual backups there are other options:
- Installing Plugins may be an easier option .Once they are set up and scheduled , it is an automated process and you do not have to do anything manually to backup. However restoration may have to be done manually.
- Most web hosting companies for eg. Siteground also save regular backups .They will restore the backup for a fee.
Here is another useful link on the manual backup of WordPress site steps
Have a great day!
Featured Image: credits PhotoMIX Ltd. from pexels.com, Photoshop CS6