Re: Upgrades and Outages
Posted: Sat Feb 21, 2015 6:15 pm
[quote="John Adams":ry1na3sa]I do have to share the one scare I had today.
Was just telling Jabantiz, that it's taken me almost 6 hours straight to try and recover the EQ2Emulators Forums database.... yes, the entire thing. All their posts, were gone. The bad spot on the drive sat right under their Posts table, of course. Almost 29,000 posts on that site spanning almost 9 years. I panicked.
After trying every thing I knew, and searching the stupid ass google/blogger/armchair "experts" on stackoverflow for hours, I finally walked away for a moment... when it suddenly hit me; what if I read the Posts table in chunks, and skipped over the bad stuff?
So I started doing "insert into new_table select * from old_table limit 0,1000" until I hit the bad spots. I got about 9,000 rows into the corrupt table. Then, it started looking bleak again. 10,000, 11,000, and so on... all bad.
Of course I had a backup, duh. But it was from the last time I moved everything (bad JA, bad!) which was Aug 2014. So I loaded up the backup. Low and behold, there were over 28,000 posts in that table... so worst come to worst, EQ2 would only lose their latest posts. That was not good enough for me!
So I had another brainstorm... when there's a bad "spot" on a drive, it's just a spot right? So, I saw the highest record ID in the backup and went to the corrupted table and did a DESC sort on that ID and what do ya know? 175 posts was all that was missing. And the corrupted table let me have them.
Peace and Tranquility has been restored to [url=http://eq2emulator.net:ry1na3sa]EQ2Emulator[/url:ry1na3sa].
F*#k I need a beer.[/quote:ry1na3sa]
Hahaha nice work mate! You definitely deserve a beer at least!
Was just telling Jabantiz, that it's taken me almost 6 hours straight to try and recover the EQ2Emulators Forums database.... yes, the entire thing. All their posts, were gone. The bad spot on the drive sat right under their Posts table, of course. Almost 29,000 posts on that site spanning almost 9 years. I panicked.
After trying every thing I knew, and searching the stupid ass google/blogger/armchair "experts" on stackoverflow for hours, I finally walked away for a moment... when it suddenly hit me; what if I read the Posts table in chunks, and skipped over the bad stuff?
So I started doing "insert into new_table select * from old_table limit 0,1000" until I hit the bad spots. I got about 9,000 rows into the corrupt table. Then, it started looking bleak again. 10,000, 11,000, and so on... all bad.
Of course I had a backup, duh. But it was from the last time I moved everything (bad JA, bad!) which was Aug 2014. So I loaded up the backup. Low and behold, there were over 28,000 posts in that table... so worst come to worst, EQ2 would only lose their latest posts. That was not good enough for me!
So I had another brainstorm... when there's a bad "spot" on a drive, it's just a spot right? So, I saw the highest record ID in the backup and went to the corrupted table and did a DESC sort on that ID and what do ya know? 175 posts was all that was missing. And the corrupted table let me have them.
Peace and Tranquility has been restored to [url=http://eq2emulator.net:ry1na3sa]EQ2Emulator[/url:ry1na3sa].
F*#k I need a beer.[/quote:ry1na3sa]
Hahaha nice work mate! You definitely deserve a beer at least!