Question

I am enhancing an existing web application and I have created a new database schema. So I need to do a database migration that will transfer the data from the old database schema to the new one, and also to update the application progressively. So the idea is that at the beginning only few services will be updated, others will just continue to work as they were before.

Do you have any advices, resources, examples that can help me with that ? If I had to do it now without checking your answers, I would have done the first task manually (using SELECT) and I would have used sql views (virtual tables) for the second task.

Anything better than that ? Let me know...

Was it helpful?

Solution

  1. Make it so that if the migration fails the new DB and old DB are unchanged.
  2. Verify validity of old data. If there is anything humans put in the database there are probably problems with it. You need to find these exceptions and probably set them a side to deal with them after most of the data is in.
  3. Verify counts and compare data to make sure you got all the things you wanted.
  4. Keep the old database, just in case.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top