One way to do this using Red Gate's SQL backup tool is to package up the script below and to deploy it as a step before doing a database deployment.
- Code: Select all
& "$SqlBackupLocation\\$ServerInstanceName\\SQLBackupC.exe" -SQL "BACKUP DATABASE `"$RedGateDatabaseName`" TO DISK = '$BackupLocation\\<auto>' WITH PASSWORD = '$Password'"
You'll need to configure the following variables in Deployment Manager for this step:
SqlBackupLocation: The place you installed SQL Backup to.
ServerInstanceName: The name of the SQL Server, as it's saved on your SQL Backup configuration
RedGateDatabaseName: The name of the database to be backed up
BackupLocation: Where to put the backup
Password: The password to encrypt the backup with.