Moving Test DB to Live Environment

  • I have a test database that I have made changes to and is ready for deployment into live. What's the best way of doing this, while still retaining all the data in live?

    For example:

    1) backup live database and restore to a temporary area

    2) generate and execute scripts from test database to create new live empty database

    3) develop SSIS package to populate the new structure with live data from the temporary copy of the live database?

    Any ideas to simplify this process would be apprciated.

    Thanks,

    Steve

  • What are the deltas between qa and prod? (Proc, data, views)?

  • Tables and sp's.

  • Another option is do buy one of the comparison tools: RedGate SQLCompare, ApexSQLCompare, xSQLCompare. These do a schema comparison and will make the changes or generate the scripts necessary to make the changes so you can review it and do it manually.

  • I assume these tools actually create a series of ALTER TABLE / VIEW commands to be run over the live database, as I notice the "Script Table As - Alter To" option is greyed out in SQL for the table / view objects (do you know when these would be enabled by the way?)

    So without these tools, the way forward i outlined above would be a good way to proceed?

    Thanks.

  • I'd really recommend spending a couple hundred $'s on one of the tools. This is likely something you'll be doing on a regular basis and the tools also help you find all changes and dependencies.

    Now to answer your question. If you are only adding columns,etc... I would script the changes, ALTER TABLE ADD column_name defintion and ALTER Procedure scripts and apply them to the live database after having backed up the database. The only issue with this will be if you need data in the new columns.

  • Personally I use Red Gate SQL Compare for the Schema Changes. I also use Red Gate SQL Data Compare once the schema changes have been loaded to add / update any referential changes that the new schema needs to allow the application(s) to function.

  • First thing is what are the changes made in test environment

    1.Like DDL changes (alter,create etc)or even DML changes(insert,update and delete to existing tables).

    2.If only DDL changes, it shouldn't really matter, a script can be prepared and deployed.

    3.If both DDL and DML, then may be you need to go for a tool!

    Have safe backups before implementing any changes.

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply