So you want to know How to Backup and Restore wordpress site?
What would happen if you woke up tomorrow and your web host had accidentally deleted your website? It happened to me. And, you guessed it: I didn’t have a backup. That won’t ever happen to me again and I’m here to help you get prepared too. It is time to know how to Backup and restore your wordpress site!
First Download and install Xcloner a Free Plugin
Click Plugins – Add New – Search for Xcloner and install or you can download manual and follow the setups below
Unzip the XCloner-Wordpress2.1.zip file. The package consists of two folders: wp-content and administrator. Upload these two folders to your WordPress root (do not upload the package to your plugin directory as you normally would with a WordPress plugin).
Log into your WordPress dashboard and click Plugins in the menu on the left.
The plugin page opens and you will see XCloner at the bottom of your list of available plugins.
Click Activate to activate the plugin.
Generate a Backup
To generate a backup go to Actions – Generate Backup in the XCloner menu or click the Generate Backup button on the XCloner start page.
XCloner backups (can) consist of two parts: a backup of your database and a backup of your files.
The Generate a backup screen consists of two tabs.
Database Options | – controls the settings for the backup of your MySQL database |
Files Options | – controls the settings for the backup of your website’s files |
Database Options
Database Backup
Backup database and include in this backup set | – Tick this checkbox for if you want to include your database in the backup. Uncheck this box if you want to exclude your database from the backup. Default is Yes. |
Add DROP SYNTAX | – Tick this checkbox if you want to add DROP SYNTAX to your database backup. It will add an extra query for each table, the DROP TABLE IF EXISTS query. When importing the sql into a database, tables that already exist, will be deleted and recreated with new data. Default is No. This option is only for advanced users. |
MySQL Compatibility | – Options are ‘default’, ‘MYSQL40’, ‘MYSQL323’. |
Select tables to exclude from backup
Current database | – Select any tables from your database that you don’t want to include in your backup. To select multiple tables, hold down the control key and select with your mouse. |
Include extra databases
To include additional databases in your backup, select them here. To select multiple tables, hold down the control key and select with your mouse.
Go to the next tab Files Options to control the settings for the backup of your files.
Files Options
1. Choose a name for your backup or leave the field blank so a name for the backup will be generated by XCloner. XCloner assigns a descriptive name that will help you remember when you made the backup and what it includes. Like this:
backup_2010-08-25_09-23_yourwebsite.com-nosql.tar | (files only backup) |
backup_2010-08-25_11-26_yourwebsite.com-sql-nodrop.tar | (files and database, no drop syntax) |
backup_2010-08-25_11-31_yourwebsite.com-sql-drop.tar | (files and database, drop syntax) |
2. Then decide if you want to exclude any files or folders from your backup. Just tick the checkbox in front of the files or folders you want to exclude. You will see those items appear on the right, in the Excluded Items List.
To go into a folder, just click on its name. To go up one level, click [Up a level] directly above the folder list.
Continue or Cancel After you adjusted all the settings for your backup, click the big Continue button in the upper right-hand corner of the window to start the backup process, or click Cancel if you don’t want to make the backup yet.
After you click Continue XCloner will start by backing up your database (if on the first tab you ticked the checkbox to include the database in the backup) and the following message will appear.
Click the red link Please click here to continue!
XCloner will now make a backup of your files. The time it takes to make the backup depends on the size of your website. You will see your browser screen refresh several times until XCloner has processed all the files.
When XCloner is done, you will see messages appear at the top and bottom of the page, showing you the number of files in the backup and the size of the backup.
Restore Backup – Automatically
To clone or restore a backup, go to Actions – View Backups in the XCloner menu on the left.
The following screen will open.
Tick the checkbox of the backup you want to clone or restore and click the Clone button. The next screen will open.
Enter the website URL where you want the backup to be moved, enter all the FTP connection settings, and the directory where you want to move the backup to. Tick the checkbox for incremental transfers if you want FTP to transfer the files in incremental mode.
Click the Continue button to proceed.
Your backup and the restore scripts will now be moved to the location you specified and you will see the following message on the next screen.
To start the actual restore process, click the click here to continue link.
You’ll be taken to the XCloner.php file on the website you specified in the clone settings and you will see the following screen.
Path Configuration
Check to make sure that the install directory, the install URL, and the backup/clone to be installed are correct.
Install directory | – Needs to indicate the full server path of where the backup will be restored to. It will replace $mosConfig_absolute_path in your configuration.php file. |
Install URL | – Is the web address from where you are able to access the install directory. If you don’t set it right you will run into template problems. If you want to update it after restore you need to edit the $mosConfig_live_site variable in your configuration.php file. |
Choose Clone Archive to Install
Select the backup you want to restore from the dropdown list.
MySQL Configuration
Import MySQL database | – Tick the checkbox if you want to import the backup of your MySQL database. If you don’t tick this box, you can skip the rest of the MySQL configuration. |
Incremental SQL import | – Tick this box if you have a large database. Your data will be transferred in an incremental transfer mode, which means that the browser will refresh the connection after 100 files have been transferred. |
MySQL server | – The new MySQL server address of the location where you are restoring |
MySQL username | – The MySQL username to access the database |
MySQL password | – The MySQL password for the selected username |
MySQL database | – The database into which you will import the MySQL backup. You will need to create this database manually before you start the restore process. If you are on the same server as the original database, for security reasons use a different database name. |
Files transfer and configuration
Skip files restore | – Tick this checkbox if you only want to restore the database and no files. |
Restore original file permissions | – Tick this checkbox if you want XCloner to restore the original file permissions of your files. |
Restore by using the server utilities unzip/tar | – Tick this checkbox if you want XCloner to make use of server utilities (if supported). |
Install files through FTP or | – If you install through and FTP session, the script will attempt to connect to an FTP server from the provided FTP details and upload the files in the provided FTP directory. When you choose FTP you also have the option to transfer your files in an incremental transfer mode; which means that the browser will refresh the connection after 100 files have been transfered. |
directly | – If you install directly, the PHP script will write all the files on the server. The only problem with this method is that on some servers the owner and group of the files will get changed to the apache default. To fix this you will need to contact your hosting support and ask them to change this for you, or, if you are allowed, use the following command through SSH (chown -R myuser directory, and chgrp -R mygroup directory) |
FTP server | – Name of your FTP server |
FTP username | – Your FTP username |
FTP password | – Your FTP password |
FTP path | – The path where the backup should be stored |
Note: Always be careful when doing a restore on a live site and make a backup first.
When you have filled out all the details on this page, click Start install to start the restore.
After you click Start install you will see the following screen. The script is now restoring your files and database to the new location.
This page will refresh a number of times until the restore script has processed all your files. The time it takes to do the restore depends on the size of your backup.
When the restore process is finished, you’ll see the following message and your clone will be accessible in its new location.
If you still need more help restoring check out the Wiki on Xcloner