restoring a wordpress database
Saturday, 26 July 2008 11:39 pm by noelposted in tech | tags: backup, database, restore, wordpress, yahoo
every wordpress blogger, me included, assumes that everything in his/her blog will go right or at least the blogger hopes and prays that things will go right. most times, it does. but occasionally, the sun burps a weird flare at the exact time a cosmic solar flare concentrator is pointed at your server and your wp_options table gets corrupt and marked “in use” so nothing else can touch it with the exception of dropping it. “dropping a table” in sql terms is equivalent to deleting a table of the database — a database is composed of at least one table.
anyway, one of the tables got blitzed — as my brother would call it — and it had to be replaced with a backup. unfortunately, the last backup was last july 16 — the table got blitzed somewhere around july 24.
one documentation i read was that i had to drop or delete all the wordpress tables in the database and then recreate and repopulate them using the backup. this made me a little queasy simply because i’m deleting the guts of a database and there’s no undo button to be seen within a 10 kilometer radius. so yes, that fact alone got my heart pumping a bit. but after the ‘x’ button was pushed there was this calmness that usually preceded a storm — i have to perform a restore. now.
the dang server does a 500 whenever i tried uploading the .sql backup. error 500 is a server error. uh oh. this is not good. uncompressed, the backup file is about 3.2 megabytes and that’s just text. my guess is that the server is timing out. the suggested solution was to copy-paste the .sql backup file in smaller parts — its just a text file so you can open it in a text editor — into the sql command window in phpmyadmin. its seriously tedious but it worked.
i eventually got the whole backup uploaded in about an hour. that was good.
what was bad was that a week’s worth of posts and comments were lost. some were recovered through google cache but there are still some that were missing. we do have the wp-db-backup plugin installed and enabled but unfortunately, scheduled e-mailing of the backup to a predefined e-mail address does not work. i’m not sure if the problem stems from my using a subdomain instead of a subdirectory for my blog. i don’t even get notices that there’s a comment awaiting moderation even though my wordpress is set to do so. i know its not the fault of the plugin because i have the same thing installed in another wordpress blog with the same host and it is installed in a subdirectory and not a subdomain and that setup works perfectly. so far its a toss up between wordpress being the culprit or my hosting provider — yahoo. i still have to do some more investigating.
in the meantime i can still use the plugin to perform backups for download to my computer. very manual and inelegant, i know, but at least that part works.
