From what I gather, this is the intended workflow:
- Create a full backup of the existing database.
This backup file is your baseline image. Move the file to a file share with a fixed location. Fixed means that the full path doesn't change when the baseline image is updated to a newer version (typically right after a successful deploy).
\\BuildServer\Data\Backups\LegacyDb.bak
- Use SSMS or PoweruP to script "Anytime" database objects (stored procedures, functions, views and indexes) one object per file. Move the scripts to directories named "sprocs", "functions", "views" and "indexes".
Note that you're not supposed to script "Onetime" database objects at this point.
Do some actual work that involves adding Onetime scripts or changing Anytime scripts. Perhaps add a new table and change a view. Update your migration scripts accordingly.
Use the "RunRestore" mode to deploy your changes to a development database and verify that your migration scripts work as intended.
In this mode, the existing database is replaced with the baseline image before executing migration scripts. Restoring the backup is necessary; otherwise, RH won't execute migration scripts that were previously executed because the version info in the development database is ahead of the baseline info. You absolutely want to be able to make changes and test changes to migration scripts for as long as they are still under development.
- When you feel confident enough, use the "Normal" mode to deploy your changes to the production database.
In this mode, RH does not restore any backups before executing migration scripts. In theory, your production database and your baseline image have remained the same throughout the sprint, so restoring the backup is not needed. Not to mention that it would probably destroy weeks/months worth of data.
If this is the first deploy, RH will create 3 tables that it uses to store its version info for that database. From now on, version info will be included in your baseline image.
- Create a database backup.
This backup file is the new baseline image for the next sprint.