database migration from test to production environment

May 10, 2011 at 10:08 AM


In real world environments usually you have a production database and a test database.

The test database is used during development (with some dummy data) and is migrated later on to the production environment.

This is how i would like to use nhydrate

Have 2 connection strings (one pointing to the test and the other to the production database)

After i do all my development and testing on the test db i will  just point it to the production db and run all the database upgrade scripts. 

Currently this approach will give me a warning information that my database versioning is not the same, but i can move on.

my questions and thoughts for improvement are:

1. Is this approach recommended and if not i think it will be good if it can be supported as it corresponds to real world issues and promotes agility in the development process.

2. Before running the install project it would be nice if i can run a verification report that will tell me what conflicts will arise when updating the database (e.g. constraint conflicts, null field values etc)

Currently you get these errors when running the install project one by one  which rollbacks the procedure. It would be handy if a verification report can show these conflicts before running the install to show a list of upgrade issues.

Sorry for such a long post.

I would like to here any other approaches for handling database evolution techniques between development and production environments.



May 10, 2011 at 11:38 PM

I would like some more information on the warning. I run test and prod environments too but never get a warning. The only warning you should get is if you are using a different model for the two databases. If you run the installer on your prod database it will get the model GUID. The next time you run it, you will not get a warning as that database now has a matching GUID. Are you saying that when you run the installer on the two databases you get a warning on one or both? Looking at the extended properties of the database (right click on the DB and select properties), do you see the same GUID?

May 11, 2011 at 10:43 AM

sorry , you are right.

the guid was different .

tried it on a new instance and worked ok.

Thanks for pointing me in the right direction.