Let me talk you through the steps necessary to restore a WordPress Site if you’re backed it up with Snapshot Backup. In principle there are four options you have:
- Restore via FTP (available to everyone, however it’s a long and tedious process)
- Restore via SSH (requires root access to your server, works much faster but not everyone has root access)
- Restore using Snapshot Restore (doesn’t exist yet… but I’m working on it)
- Ask me to restore a Snapshot for you (small fee involved for my time)
In this article I’ll describe Option 1: Restoring a Snapshot via FTP.
Let’s assume you’re on shared hosting with the likes of Hostgator, Bluehost, etc and you have access to the Snapshot you’d like to restore. Download the Snapshot file to your local computer (let’s assume it’s called snapshot.tar) and have the following tools ready and installed:
- an FTP client like FileZilla
- an unZIPping programme such as WinZIP or WinRAR (or the Mac / Linux equivalents)
- access to phpMyAdmin (via your hosts control panel)
Grab a coffee and let’s get going!
PLEASE NOTE: Following these instructions will OVERWRITE your current website entirely.
The first thing we want to do is to unTAR everything in your snapshot file to a fresh folder on your local machine. WinZIP and WinRAR are suitable for this task, or any programme that can read the TAR format. It’s just like opening a ZIP archive.
In this new folder you should now find several sub folders, depending on your installation. The default ones are
and several lose files in the main directory – just like the site you had. Using your FTP client, upload all these files and sub folders into the directory you use for hosting your website. It’ll be something like www or htdocs or httpdocs – your host will be able to tell you. Whatever worked at the time you took the Snapshot. You can overwrite files currently on your server.
Now we need to take care of the database. On your local computer have a look in the wp-content/uploads folder for a file that ends with .sql (it’ll be called something like snapshot-db-123456-1234.sql). Remember where that is – I’ll just call it “your database file” from now on.
Find access to phpMyAdmin from your hosts’s control panel. It’s a fairly straightforward yet slightly firghtening web based tool if you’ve not used it before – but we’ll get through this. On the left hand side you see all the databases you’ve got under your control. Click on the one you’re using for your WordPress site.
If you’re not sure which one this is have a look at your wp-config.php file.
Now we’re deleting all entries that relate to your site. These typically start with a prefix like “wp_” but this could have been changed in your wp-config file.
If you’re only hosting one site out of this database then you can drop all entries here. However if you’ve installed another application that also uses this database then you must make sure not to delete anything that belongs to said project. Export all tables if you’re not sure.
Once your database is empty (or all WordPress related records have been deleted) you can import your database file that was saved with your Snapshot. To do this, head over to IMPORT, select your database file and upload it.
Assuming all went well, your site is now back live as it was on the day you took the Snapshot.
Wait! My Database File is too big to upload…
That’s a common problem I’m afraid – some hosts only allow you to upload files of 2MB and under via phpMyAdmin – if yours is bigger then have a look at a free utility called Bigdump – this will help you out.
What if I want to restore my Snapshot to another domain?
That’s possible – all you need to do is change a couple of values in the database:
In the wp_options table, look for option_id “siteurl” and change it to the current domain you’re using. That’s usually the first one in the list.So if your site used to be www.example.com and now it’s newsite.com, change it to the latter.
Another one is “home” which should point at the installation URL of your site. Say your WordPress installation is in http://www.newdomain.com/blog then this is what you need to change it to.
All this is beyond my capabilities and my head hurts. Can you help?
Of course I can – for a small fee I can restore a Snapshot for you. Click here for details.
As I said before, I’m currently working on Snapshot Restore which will make restoring your website just as easy as snapshotting it. It will be released later this year – watch this space.
Good luck and all the best from London 😉