5
kurtr
7y

<sanityCheck> //asking for a friend

Some clever b*****ds wrecked a section of our production mysql db. To fix it I need to rollback the affected records 2 weeks - around 50/300 tables are affected, the other data must remain intact.

Currently my plan is to take a 2 week old dump and cherry pick the data I need from it, then combine it with a dump of the db in it's current state, drop the db and recreate it.

I know this approach will work - but it's risky, a pain in the ass and dealing with 300mb text files is tedious so since I only need to start in around 8 hours I figured It wouldn't hurt to post my approach and see if anyone thinks my plan is borderline retarded.

If you have any advice .etc that will make my life easier I would greatly appreciate it.

So in your opinion...

- is there a better/safer way?
- do you know of any db dump merge tools?
- have a recommended (linux) text editor for large text files?
- have you made any personal mistakes/fuck ups in the past you think I should avoid?
- am I just being a moron and overthinking this?
- if I am being a moron - In your humble opinion has the time come for me to give up all hope and pursue my dream of becoming a professional couch surfer?

</sanityCheck>

Note: Alternatively, if your just pissed that my rant is asking for a solution instead of simply trashing the people that created my situation and your secretly wishing it was on SO where it belongs so you can moderate/edit/downvote/mark the shit out it, feel welcome to troll me in the comments (getting dev advice just doesn't feel reliable without a troll - you matter to me). Afterwards If your panties are still in a bunch I'll post it on SO and dm a link to you to personally moderate - my days already fucked and I wouldn't want to ruin yours too.

Comments
  • 1
    How about writing a server side script to find and fix the wrong data?
  • 1
    @CurseMeSlowly It would take just as long if not longer than merging the dump files - the biggest problem is the data has a shit ton of relations and thanks to the the table structure (no time stamps) it's almost impossible to tell good data from bad programatically.
  • 2
    Updated Plan:

    Found a mydump extraction tool on github that looks really promising and I'm busy testing it out. Will post an update if it works out.

    Thank heaven for open source and the developers like this guy who support & add to it.

    https://github.com/kedarvj/...
  • 1
    Good luck buddy.
Add Comment