Hi All,
We have an existing web application with about half a million records now. Not very large but too large to manually restore. The issue is we have (almost always) implement(ed) new features that affected the definition of some of the pojos that is mapped to hibernate. And what we need to do is backup the current records, load up the new pojos, hence slightly altered rdbms structure. And then restore the (previously backed up) records.
Btw were using MySQL 5. I think our domain model is a bit complex with lots of implentation of subclasses and class by hierarchy mappings.
The few steps we took:
1. Load the old domain model and serialized them into a file, for the backup procedure. For restore, we de-serialized the file using the new revisions of the domain model. At this point we will have to manually debug for serialVersionUID errors on the new pojos. This is how we do it right now but its a very cumbersome process and not to mention slow.
2. Were also looking at Xstream but lot of xstream errors appeared when we started to deserialized the topmost pojo.
3. Also tried loading 2 sets of domain model, for example the main tree is com.domain.model.* and then I copied and tweaked the pojos to be contained in com.domain.model.backup.* structure. I stopped when I got a hibernate error (something on the .xdt) while running schemaexport ant target.
The last option I can think is to load the domain model and dynamically create them into a separate database ( dependency on domain structure is not existent at this point ) as a backup db. Then load the new version of domain model (could be a separate application) and then restore the records.
Unfortunately we don't much have the luxury of time to extensively research on some of the methods above. So I'd rather waste time on the most probable approach.
I hope someone here has been on the same situation or something like it, maybe they can share how they do it? Or maybe someone here knows of a tool that can handle such task.
Thanks in advance.
Best regards,
Richard
|