-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Data migration from old to new version
PostPosted: Sat Jun 16, 2007 2:14 pm 
Newbie

Joined: Thu Jan 04, 2007 12:27 am
Posts: 8
Are there some good known strategies for migrating data between different versions of app using hibernate.
The problem I am facing is that IDs are generated by database in the initial version. In the new version i want to use same IDs for consistency but hbm file wont allow an assigned ID.
Doing this stuff directly with importing db dump is straightforward but i want to use the object model so that rest of the system is in sync.

Any pointers?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 18, 2007 5:17 am 
Regular
Regular

Joined: Wed May 05, 2004 8:01 am
Posts: 53
Usually when upgrading an application I do a dump of source base (MySQL) and write (manually), a migration script that adds columns, renames tables etc.

I keep a separate migration file for every relase and apply them sequentialy.

This way you do not touch your existing entities at all. All ids are not touched at all.

Please rate if that helps.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 18, 2007 6:53 am 
Newbie

Joined: Thu Jan 04, 2007 12:27 am
Posts: 8
Doing without touching the domain model with sql dump works if rdbms is the only place where data resides. In my case the domain model maps to RDBMS as well as other data sources like files, search indexes. This requires me to make all updates go through the domain model and service layer for consistency.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.