WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Trouble recovering data from database backup only - Site files deleted (7 posts)

  1. su2al
    Member
    Posted 2 years ago #

    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.)?

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    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.

  3. su2al
    Member
    Posted 2 years ago #

    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?

  4. fonglh
    Member
    Posted 2 years ago #

    18226 was WP 3.2

  5. su2al
    Member
    Posted 2 years ago #

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

  6. fonglh
    Member
    Posted 2 years ago #

    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.

  7. su2al
    Member
    Posted 2 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic