Database schemas WAY out of sync - need to get up to date without losing data

Posted by Zind on Stack Overflow See other posts from Stack Overflow or by Zind
Published on 2010-03-08T20:58:03Z Indexed on 2010/03/08 21:06 UTC
Read the original article Hit count: 273

The problem: we have one application that has a portion which is used by a very small subset of the total users, and that part of the application is running off of a separate database as well. In a perfect world, the schemas of the two databases would be synced up, but such is not the case. Some migrations have been run on the smaller database, most haven't; and furthermore, there is nothing such as revision number to be able to easily identify which have and which haven't. We would like to solve this quandary for future projects. During a discussion we've come up with the following possible plan of action, and I am wondering if anyone knows of any project which has already solved this problem:

What we would like to do is create an empty database from the schema of the large fully-migrated database, and then move all of the data from the smaller non-migrated database into that empty one. If it makes things easier, it can probably be assumed for the sake of this problem specifically that no migrations have ever removed anything, only added.

Else, if there are other known solutions, I'd like to hear them as well.

© Stack Overflow or respective owner

Related posts about sql

Related posts about database