Database recovery from production.log

Hi guys,

Anyone has tried before a database recovery from the production.log ?

Apparently, because a bug from a gem, some tables were complete deleted. I only have a backup from 3 months ago. There is no change in scheme, just new data was added.

I’ve made a quick search and some people already tried a recover from log file, but it’s not clear if it worked or not. Anyone here already did this and was successful ? Is there a tool out there ?

Thanks,

Ernesto

You might have better luck asking this on a mailing list/forum specific to whatever DB you're using.

Thanks,

I’ll try there too. BTW, I’m using mysql.

gem ‘mysql2’, ‘0.2.7’

rails 3.0.10

Ernesto

If you're looking for recovery options, you should probably identify the MySQL version and platform as well.

Good luck,

One could possibly slam together a script to do this but consider what you have to work with (this will depend on your ROR version): On the version I am using the information in the production log file is the controller/method being called, the HTML verb and the parameters. The controller figures out what is fed to what model. If your app is very simple it might be feasible. You could possibly put something together using something like curl to feed the the proper requests into the server and have your app just act on them.

I just did a manual recovery similarly and it a lot of time just to cover a few dozen transactions between browser and server.

The lesson from this is obvious, you need backups! I have a job set up to dump my mysql database daily and forward a copy to another system periodically.

Good luck Norm