Support » Everything else WordPress » Trouble recovering data from database backup only – Site files deleted

  • Resolved su2al


    So I had a couple of sites that I was managing using WordPress. I had to take the sites down over a year ago, and hastily made a full backup of the databases of both sites. Once that was done I deleted both site folders from the folder without having the foresight to back them up as well.

    I don’t remember the version of WordPress I was running at the time, but I took the backup on 9/27/2011. The backup files have the format: sitename.sql.gz

    Now I’m trying to get the sites back up. I tried importing the backup files into the database of a fresh wordpress install – using phpMyAdmin – but the just turns all the pages blank. I did some research and changed the data in the options table of the DB to correspond to the location of the new installation but the still gives me the same issues.

    What am I doing wrong? and is this even possible considering I don’t have the original site files (theme, pics, etc.)?

Viewing 6 replies - 1 through 6 (of 6 total)
  • esmi


    Forum Moderator

    You’ll need to check your database backup to find out what version of WP you were using. The database version number is stored in the wp-options table under the option name db_version.

    I just checked and the DB version has a value of 18226.
    Edit: How do I know which WP version the DB version values corresponds to?

    18226 was WP 3.2

    Thanks fonglh. So now that we know which WordPress version it was, I hope someone can tell me how I can recover the data.

    Install WordPress 3.2 with no plugins and use the default theme. Point the wp-config.php file to your db and see if it works.

    If not, check your server error log to see what PHP error is causing the problem.

    It took a bit of tinkering but I got the data back.
    The steps I took were as follows:
    1_ Imported database backup to an empty DB on the server.
    2_ Installed WP 3.2 with no plugins or theme changes.
    3_ Changed fields in the options table of the DB to correspond to new URL.
    4_ Modified wp-config to point to the restored DB.
    5_ The home page was blank but the wp-admin login page worked. I just logged in and did the automatic update to WP 3.4.1 and everything went back to normal.

    Note: If you get a DB connection error, check that the username and password for your DB in the wp-config file are correct.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Trouble recovering data from database backup only – Site files deleted’ is closed to new replies.