You may want to backup your WordPress site to your computer for Development purpose or as a backup of your site. But it’s not that easy to create an exact replica of your live site on your computer. Backing up your WordPress site to your local server [Offline, on your computer] requires you to have the WordPress core files, your wp-content files and folders and your entire database.
So, in order to create a backup of your WordPress site on your computer you have 3 (three) ways to do it:-
- Manually – By Downloading the files, folders and media files.
- BackupBuddy – Cloning your WordPress using BackupBuddy Plugin.
- wpTimecapsule – Using this service to get all your WordPress files.
Without any more chit chat, let’s jump into the details – Backup WordPress Site to Computer
1. Manually – By Downloading the files, folders and media files.
If you already have some files and folders from your WordPress on your computer and want to download only those files and folders that you don’t have, then this method is the perfect fit for you. Downloading manually all the files, folders and media files is a bit tiring, time-consuming and its manual process.
[This process is not recommended for new bloggers or the ones who are new to cPanel and phpMyAdmin, its best suited for developers who know what they want.]
To get started you will need the following.
- A local server running on your computer (Using xampp, wamp or mamp).
- Access to your cPanel & phpMyAdmin.
- WordPress core files (optional).
So I assume you have local server running on your computer, if not then here is How to Install a local Server on Computer for WordPress. First setup a local directory on your local server/host with the same name as your WordPress directory on your cPanel, in order to make the offline site function the same as your live server.
Login to your cPanel > File Manager and select the folder where your WordPress files resides. Compress and zip them up through your file manager in cPanel. Download them to your computer. Once downloaded extract them to a new folder in your local server/host by creating a new folder with the same name as the folder in your cPanel.
After unzipping and extracting the WordPress files to the folder, edit the wp-config.php and change the values of host, user, password. You dont need to change the database name as we are going to create a new database with the same name.
Login to your cPanel > phpMyAdmin and locate your WordPress database. Click the database name from the left sidebar and then choose the click on the “Export” tab. On the following screen, select the “Custom” export method. You will then be presented with a selection of databases to export:
Create a database in your localserver > phpMyadmin with the same name as on your cPanel > phpMyAdmin’s database name. Click the import tab on your localhost > phpMyadmin and import the csv file that you have exported in the previous step.
After you are done creating and importing data to your new offline database, you need to edit a few things on your offline database. Click the database name and search for “wp_options” table, you’ll see a list of table names like this:
The two fields you need to edit are “siteurl” (highlighted above) and “home” (sometimes you may need to navigate the second page to find). Just click the “Edit” buttons next to each field, and replace the URL contained in “option_value” with “http://localhost/yourfoldername/” which is your offline URL for your WordPress site running on local server.
That’s it! If you now navigate to “http://localhost/yourfoldername/”, your site should load up in all its glory. Please note that if you use custom permalinks, you will need to change them to default permalinks you use in your live site. To change permalink, Visit wp-Admin > Settings > permalinks.
2. BackupBuddy – Cloning your WordPress using BackupBuddy Plugin.
This is the best and the easiest process to backup your WordPress site to your computer. BackupBuddy has several features from backup to cloning, you can check our unbiased Review of BackupBuddy Plugin. BackupBuddy comes with a very easy option t backup your entire site to your computer or clone it to any url on local server or any remote server.
It comes with a simple and easy migration wizard that provides you a file named importbuddy.php which you upload to your new server or your offline development folder and run the file by accessing it through the URL.
Before you run the script through your browser, you need to download the zip file from the same page of BackupBuddy or your remote cloud server where your backupBuddy has saved the backups. Once you have downloaded the zip file, place it on your local server folder and run the script through the url. Your url should look something like http://localhost/yourfoldername/importbuddy.php
Follow the onscreen steps and your offline site is ready and you will have a complete Backup of your WordPress Site to your Computer.
3. wpTimecapsule – Using this service to get all your WordPress files.
I’m in Love with wpTimecapsule right now, for the automatic incremental WordPress backup that it provides for free of charge. Many other services that provides the same service, comes with a premium plan which you need to pay to get access. If you are curious to know what is wpTimeCapsule and How To Create Automatic WordPress Backups For Free With WP Time Capsule, we have a complete article dedicated for it.
wpTimeCapsule saves your entire WordPress files, folders and database to your choosen remote cloud storage. So lets take you have chosen Google Drive to save your backups from your wpTimeCapsule. So google drive provides you an easy desktop app to sync your files on your computer.
Sync all the files and folders to your offline computer. Once fully synced copy the entire folder to your local server folder which you are going to use as the folder for your offline site. Your database is backed in a separate folder. To access your database open your localserver folder > Uploads > tCapsule > Backups.
Open your phpMyAdmin on your localserver and import the database that is mentioned above. Once you have imported, you need to edit to things.
- wp_options in phpMyAdmin
Edit the wp-config.php, which is located in the root of your localserver folder and change the values of host, user, password. You dont need to change the database name as we are using the database with the same name.
After editing the wp-config.php you need to edit your wp_options table in phpMyAdmin and find “siteurl” and “home” (sometimes you may need to navigate the second page to find). Just click the “Edit” buttons next to each field, and replace the URL contained in “option_value” with “http://localhost/yourfoldername/” which is your offline URL for your WordPress site running on local server.
That’s all, we hope this article helped you learn how to backup WordPress site to your local computer. You may also be interested to know the 9 Best WordPress Plugins For Backup And Restore.