We develop and support and application that uses Hibernate as an Object-Relational Mapping tool to persist our Java objects into the database. Unfortunately, there have been some changes in object model, and thus the database schema, between OurApp 1.0 and OurApp 2.0. So, we would like to write an automated tool to migrate the data from databases of customers using OurApp 1.0 to a new database with a schema matching OurApp 2.0.
We were thinking of creating a tool that has two versions of each Java class. For example we might have a Java class MyObject_1_0 that matches the MyObject class as it appears in OurApp 1.0 and a MyObject_2_0 that matches the MyObject class as it appears in OurApp 2.0. We would then write code that knows how to convert a MyObject_1_0 to a MyObject_2_0.
However, this isn't something I've done before and I'd like to know if this is the best approach. It would be nice if I could review some literature and research on best practices and common pitfalls. Can anyone recommend books or articles that I might find useful as we research the most effective ways to do this?
Thanks!