How to restore your Snapsnot via FTP

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:

  1. Restore via FTP (available to everyone, however it’s a long and tedious process)
  2. Restore via SSH (requires root access to your server, works much faster but not everyone has root access)
  3. Restore using Snapshot Restore (doesn’t exist yet… but I’m working on it)
  4. 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

  • wp-admin
  • wp-content
  • wp-includes

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 😉

Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or draw on tablet devices. He blogs about his coding journey at http://wpguru.co.uk and http://pinkstone.co.uk.

13 thoughts on “How to restore your Snapsnot via FTP

  1. FTP upload works as described. It would be a nice plug-in feature/option to use a non-standard TCP port for FTP.
    Keep up the good work, and thank you for this plugin. I am just testing it now and if it does everything I need, I’ll be glad to make a donation.

    1. Thanks Kevin, really glad to hear it’s working for you. Custom FTP ports is on my list of things to do and will be available in a future update.

      I’ll keep you posted 😉

  2. hello,

    A question for you. The backups are working fine. But I just checked the tar file and there is NO .sql file in the wp-content/uploads folder.

    Am I doing something wrong??

    please advise

    alex

  3. Well, that is what i am doing
    I downloaded the tar file from the ftp and unrared the files on my pc into a folder
    There I could not find it in the wp-content/upload folder.

    1. That’s not good! Who are you hosting with? Sometimes hosts don’t let you use shell commands (such as mysqldump – which is what I’m using to extract the database). On my list of things to do is implementing better checks at each stage. Now it’s funding the time to do it.

      Sorry it’s not working out for you – have a look at VaultPress, or as a free alternative WP-DB-Backup by Austin Matzko. http://wordpress.org/extend/plugins/wp-db-backup/

  4. Hi
    I’ve been trying to restore the backup and have uploaded all the files.
    But you say i have to delete all the wp’s in the database of admin?
    Are you sure?
    If not what should i do?
    Urgent please.
    I believe this is a very difficult way to backup and restore!
    Thanks for you fast respons

    1. Hi GeePee,

      You don’t have to delete anything in your existing database, you can just setup a new one and import the .sql file into that.

      Once you unTAR the snapshot the .sql file is located in wp-content/uploads

Comments are closed.