<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Database schema migration with LiquiBase</title>
	<atom:link href="http://dobesland.wordpress.com/2008/01/08/database-schema-migration/feed/" rel="self" type="application/rss+xml" />
	<link>http://dobesland.wordpress.com/2008/01/08/database-schema-migration/</link>
	<description>Dobes Vandermeer - Software Engineer, Aspiring Buddha</description>
	<lastBuildDate>Sat, 07 Nov 2009 16:40:44 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mark</title>
		<link>http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-373</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Tue, 30 Jun 2009 12:52:34 +0000</pubDate>
		<guid isPermaLink="false">http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-373</guid>
		<description>I recently implemented a JDBC driver wrapper with schema deployment support The driver runs database migration scripts automatically at connect time.  Currently the driver supports LiquiBase and my own internal schema manager.
http://markfarnsworth.wordpress.com/2009/06/27/garin/</description>
		<content:encoded><![CDATA[<p>I recently implemented a JDBC driver wrapper with schema deployment support The driver runs database migration scripts automatically at connect time.  Currently the driver supports LiquiBase and my own internal schema manager.<br />
<a href="http://markfarnsworth.wordpress.com/2009/06/27/garin/" rel="nofollow">http://markfarnsworth.wordpress.com/2009/06/27/garin/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexwebmaster</title>
		<link>http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-339</link>
		<dc:creator>Alexwebmaster</dc:creator>
		<pubDate>Tue, 03 Mar 2009 10:55:12 +0000</pubDate>
		<guid isPermaLink="false">http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-339</guid>
		<description>Hello webmaster 
I would like to share with you a link to your site 
write me here preonrelt@mail.ru</description>
		<content:encoded><![CDATA[<p>Hello webmaster<br />
I would like to share with you a link to your site<br />
write me here <a href="mailto:preonrelt@mail.ru">preonrelt@mail.ru</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dobes</title>
		<link>http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-249</link>
		<dc:creator>dobes</dc:creator>
		<pubDate>Wed, 02 Apr 2008 03:47:36 +0000</pubDate>
		<guid isPermaLink="false">http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-249</guid>
		<description>Hi Marlin,

I&#039;ve been using liquibase for my schema migrations with some success now.

My schema migration process goes like this:

1. Make changes to the hibernate annotations/schema

2. Test those changes using ejb3unit against a unit-testing-only database I call &quot;ejb3unit&quot;, which is created by hibernate&#039;s schema export feature in drop-create mode; I configure ejb3unit to use that test database via its properties file.

3. Generate a liquibase diff from the last deployed database schema and the &quot;ejb3unit&quot; database.

4. Manually inspect the diff and decide whether anything was done that requires data conversion, and if so, insert custom classes and/or SQL that does the conversion and append that to the liquibase changelog I am using.

5. Deploy the new app to glassfish on my development machine, which will update the schema based on the new entries in the changelog, and test it manually to be sure the schema is correctly upgraded.

I feel pretty good about this methodology, I think it is robust because it incorporates unit testing into the process, and it doesn&#039;t require a lot of save/load work to migrate schemas.

I does require the occasional bit of SQL hacking for a migration, since I can&#039;t use hibernate in the data conversion classes, but most operations are just adding/removing fields.</description>
		<content:encoded><![CDATA[<p>Hi Marlin,</p>
<p>I&#8217;ve been using liquibase for my schema migrations with some success now.</p>
<p>My schema migration process goes like this:</p>
<p>1. Make changes to the hibernate annotations/schema</p>
<p>2. Test those changes using ejb3unit against a unit-testing-only database I call &#8220;ejb3unit&#8221;, which is created by hibernate&#8217;s schema export feature in drop-create mode; I configure ejb3unit to use that test database via its properties file.</p>
<p>3. Generate a liquibase diff from the last deployed database schema and the &#8220;ejb3unit&#8221; database.</p>
<p>4. Manually inspect the diff and decide whether anything was done that requires data conversion, and if so, insert custom classes and/or SQL that does the conversion and append that to the liquibase changelog I am using.</p>
<p>5. Deploy the new app to glassfish on my development machine, which will update the schema based on the new entries in the changelog, and test it manually to be sure the schema is correctly upgraded.</p>
<p>I feel pretty good about this methodology, I think it is robust because it incorporates unit testing into the process, and it doesn&#8217;t require a lot of save/load work to migrate schemas.</p>
<p>I does require the occasional bit of SQL hacking for a migration, since I can&#8217;t use hibernate in the data conversion classes, but most operations are just adding/removing fields.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marlin</title>
		<link>http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-248</link>
		<dc:creator>Marlin</dc:creator>
		<pubDate>Wed, 02 Apr 2008 02:29:37 +0000</pubDate>
		<guid isPermaLink="false">http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-248</guid>
		<description>We also chose to use hibernate with annotations so, as a small team of Java developers, we could focus on getting a great product out rather than on serializing and deserializing objects.  That mostly worked, though Hibernate+Spring+Tapestry had some quirks (still does).  As time goes on, we add new features, we refactor, and we have existing customer data to migrate to a new release...

To use a traditional ETL, we&#039;d have to know more about how Hibernate maps things than we want to (and we already know too much).  I didn&#039;t find anything that would help map one object graph to another, so I created my own Java program to read objects from the old database and write them to the new database.

To do so, the program has to have both the new and the old object definitions around, and hibernate sessions to the old and new databases.  To reference the old objects, I renamed the top level package in the old version (com.foo to com.fooV230) and created a library with those classes.  The migration (eclipse) project has this library and references the current code base with the new object schema, and the program that reads old objects, copies to new objects, does a little processing, and writes the new ones out to the new database.  It&#039;s useful and it&#039;s painful.  It&#039;s useful when there is some processing and default-setting to do from one version to another.  It&#039;s painful to set up, ensuring that each and every field is copied correctly.

But once it is set up -- preferably before any model changes have been made to the target project -- the migration project is kept open by each developer and each developer must make changes to it when he or she changes the object model.  If we&#039;ve made hibernate annotation changes for performance or other reasons, the target database receives them transparently.  At the end of development, we do some extra testing and clean up, and pass it off to the test team.

So far, it&#039;s worked, but I&#039;m keeping my eyes open for a better way, or a tool that makes it simpler (requiring less high-level engineering time).  I&#039;m interested to hear how you solved your hibernate/annotations data migration...</description>
		<content:encoded><![CDATA[<p>We also chose to use hibernate with annotations so, as a small team of Java developers, we could focus on getting a great product out rather than on serializing and deserializing objects.  That mostly worked, though Hibernate+Spring+Tapestry had some quirks (still does).  As time goes on, we add new features, we refactor, and we have existing customer data to migrate to a new release&#8230;</p>
<p>To use a traditional ETL, we&#8217;d have to know more about how Hibernate maps things than we want to (and we already know too much).  I didn&#8217;t find anything that would help map one object graph to another, so I created my own Java program to read objects from the old database and write them to the new database.</p>
<p>To do so, the program has to have both the new and the old object definitions around, and hibernate sessions to the old and new databases.  To reference the old objects, I renamed the top level package in the old version (com.foo to com.fooV230) and created a library with those classes.  The migration (eclipse) project has this library and references the current code base with the new object schema, and the program that reads old objects, copies to new objects, does a little processing, and writes the new ones out to the new database.  It&#8217;s useful and it&#8217;s painful.  It&#8217;s useful when there is some processing and default-setting to do from one version to another.  It&#8217;s painful to set up, ensuring that each and every field is copied correctly.</p>
<p>But once it is set up &#8212; preferably before any model changes have been made to the target project &#8212; the migration project is kept open by each developer and each developer must make changes to it when he or she changes the object model.  If we&#8217;ve made hibernate annotation changes for performance or other reasons, the target database receives them transparently.  At the end of development, we do some extra testing and clean up, and pass it off to the test team.</p>
<p>So far, it&#8217;s worked, but I&#8217;m keeping my eyes open for a better way, or a tool that makes it simpler (requiring less high-level engineering time).  I&#8217;m interested to hear how you solved your hibernate/annotations data migration&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dobes</title>
		<link>http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-219</link>
		<dc:creator>dobes</dc:creator>
		<pubDate>Wed, 09 Jan 2008 22:42:56 +0000</pubDate>
		<guid isPermaLink="false">http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-219</guid>
		<description>Thanks for bringing XStream to my attention, I hadn&#039;t seen that before.  It looks very, very useful to me right now.

Ah sweet, they even have annotations!  Awesome!</description>
		<content:encoded><![CDATA[<p>Thanks for bringing XStream to my attention, I hadn&#8217;t seen that before.  It looks very, very useful to me right now.</p>
<p>Ah sweet, they even have annotations!  Awesome!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmitri Livotov</title>
		<link>http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-218</link>
		<dc:creator>Dmitri Livotov</dc:creator>
		<pubDate>Wed, 09 Jan 2008 22:24:46 +0000</pubDate>
		<guid isPermaLink="false">http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-218</guid>
		<description>Yes, but we&#039;ve used XStream (initially) to serialize POJOs from model to a our own backup file (coupled with trueZip this brings a solid single backup file transparently). In case, if in a new version of software, the object model changes, for instance, bringing a couple of new fields, this is handled transparently with XStream on de-serialize. Of course, in a complex model changes this requires to be supported in restoration code too, however, this is not very hard to maintain, especially, if model was accurately designed initially (it then does not require a lot of complex changes)</description>
		<content:encoded><![CDATA[<p>Yes, but we&#8217;ve used XStream (initially) to serialize POJOs from model to a our own backup file (coupled with trueZip this brings a solid single backup file transparently). In case, if in a new version of software, the object model changes, for instance, bringing a couple of new fields, this is handled transparently with XStream on de-serialize. Of course, in a complex model changes this requires to be supported in restoration code too, however, this is not very hard to maintain, especially, if model was accurately designed initially (it then does not require a lot of complex changes)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dobes</title>
		<link>http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-217</link>
		<dc:creator>dobes</dc:creator>
		<pubDate>Wed, 09 Jan 2008 09:01:49 +0000</pubDate>
		<guid isPermaLink="false">http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-217</guid>
		<description>Well, that seems like a nice approach, but it does mean that you have to perform migrations on your data dump/load schema.  However, if the file format is written by hand, that&#039;s not too hard ... maybe not as hard as learning and using tools like these.

Definitely something to think about.</description>
		<content:encoded><![CDATA[<p>Well, that seems like a nice approach, but it does mean that you have to perform migrations on your data dump/load schema.  However, if the file format is written by hand, that&#8217;s not too hard &#8230; maybe not as hard as learning and using tools like these.</p>
<p>Definitely something to think about.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmitri Livotov</title>
		<link>http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-216</link>
		<dc:creator>Dmitri Livotov</dc:creator>
		<pubDate>Wed, 09 Jan 2008 08:57:38 +0000</pubDate>
		<guid isPermaLink="false">http://dobesland.wordpress.com/2008/01/08/database-schema-migration/#comment-216</guid>
		<description>Interesting tool.  And in my projects I came to creating the DB-independent backup/restore tool, that backups the entire object model to a backup file and then restores it back, allowing to make a backup, update the software with dropping and re-creating a schema and finally restore data. This also brings another &quot;bonus&quot; - ability to move data across various database vendors easily.</description>
		<content:encoded><![CDATA[<p>Interesting tool.  And in my projects I came to creating the DB-independent backup/restore tool, that backups the entire object model to a backup file and then restores it back, allowing to make a backup, update the software with dropping and re-creating a schema and finally restore data. This also brings another &#8220;bonus&#8221; &#8211; ability to move data across various database vendors easily.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
