WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Recover from server crash - Ubuntu (2 posts)

  1. uruguay96
    Member
    Posted 1 year ago #

    I was running a few wordpress sites on an ubuntu server (11.04) . It crashed but I was able to pull the hard-drive and make a copy of the entire system. I have now installed on more reliable hardware running ubuntu 12.04 server.

    Question:
    How do I restore the wordpress content and databases? Is this possible?

    Things I have tried:
    I tried copying over the entire /var/www/ folder but that didn't work (database issues).
    I tried re-installing wordpress fresh (newest), associating with a new database (same name as before using phpmyadmin), and then copying the old wp-content folder over. The webpage would not show up and nothing worked.

    It appears to me that the database issue is what is confusing me. How do I restore based upon what I have? Where are all the mysql databases stored at anyway? Not under /var/lib/mysql like I have heard from other websites...

    Any help would be greatly appreciated!

  2. uruguay96
    Member
    Posted 1 year ago #

    OK, I figured this out. Even though my SQL database wasn't saved while I transferred files over the first time, I was lucky enough that the hard drive could still boot up on a spare PC I had laying around (it didn't work on various others). With the Ubuntu server running, I was able to change the IP to work on my local network and then browse to the localhost/phpmyadmin page from a laptop. From there I could export my SQL database. With this, I was able to take a completely new hard drive and install everything fresh. I unzipped a new copy of wordpress to the same folder path I had before, then imported the SQL database, and then ran the install script. It found the old database and connected. Then I copied over all data from the old wp-content into the new wp-content folder. And I was back and running.

    The only other gotchas were simple linux things that I had forgotten:
    changing ownership of all docs to www-data... making sure my permalinks were working by enabling mod_rewrites, etc.

    Note, it is important the order for the install, I couldn't just copy the entire backup, I had to start with a fresh wordpress unzip, then import the database, and then run the auto-install for wordpress. Then after that, you can move over the wp-content.

    Hope this helps anyone with a similar issue (if you don't backup off-site like you're supposed to).

Topic Closed

This topic has been closed to new replies.

About this Topic