The client definitely had the same problem a few weeks ago. I came up with the following solution:
- reproduce the last backup you have (in our case, it was one year old)
- write a small parser that moves all requests from production to a temporary database (I chose mongodb for this): I used the rake task and "eval" to create the hash.
- play data in the following order
- play in the first creation of the object, if it does not already exist.
- Find the latest update (by date) and play it.
Here is a regex for scanning production.log:
file = File.open("location_of_your_production.log", "rb") contents = file.read contents.scan(/(Started POST \"(.*?)\" for (.*?) at (.*?)\n.*?Parameters: \{(.*?)\}\n.*?Completed (.*?) in (.*?)ms)/m).each do |x|
In my case, the temporary database accelerated the process of parsing the log file, so the above steps could be taken. Of course, everything that was not sent over production.log will be lost. In addition, updates to the objects will send all the information, it may be different in your case. I could also recreate the loading of images, since the images were sent base64 encoded in the production.log file.
Good luck
source share