You’re coding away with SSIS, happy as a clam, and it’s now time to deploy your hard work to an instance of the SSIS Catalog. If you’re in Visual Studio, you right-click the project name in Solution Explorer and click Deploy. If you’ve been given an ISPAC file, you double-click it in windows Explorer. Either way, the Integration Services Deployment Wizard starts and you (happily) supply the SSIS Catalog host instance and choose (or create) the SSIS Catalog folder click Next buttons until you click the Deploy button. It’ll be just a minute now, and you’ll see four green circles with checks…
Except you don’t.
You see three green circles with checks and one ugly red circle that contains an X:

“ kaboom ”
What’s worse, there’s an ERROR message box sporting another of those handy red-X circles that states:
Please create a master key in the database or open the master key in the session before performing this operation. (Microsoft SQL Server, Error: 15581)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=13.00.4199&EvtSrc=mssqlServer&EvtID=15581&LinkId=20476
Ok, not to worry. Copy the For-help-click URL and paste…

This isn’t the site you are looking for… What Now?
I’ve seen this happen in the wild. It’s not pretty and never convenient. Sometimes, someone has “saved all sorts of time and money” by backing up the SSISDB database say, on a Production server and restored it to a QA server using code similar to this:

And that restore executes and succeeds just like the one I’ve shown above. Everything’s good to go, right? Well, everything looks good to go…
With the restore complete, you’re ready to deploy the latest updates to QA for testing. That’s when this particular error rears its ugly head.
How Do I Fix It, Andy?Fix #1
I’m glad you asked! SSISDB is not your ordinary, run-of-the-mill database. There’s an application built around it. I can hear you thinking, “That’s pretty ordinary, Andy…” and you’re right. But most of the applications databases work with are not built into SQL Server Management Studio (SSMS) , now are they? SSISDB’s application is found in the SSMS Object Explorer node named “Integration Services Catalogs.”
Microsoft has some very helpful instructions at a page named Backup, Restore, and Move the SSIS Catalog (for SSIS Catalogs in SQL Server 2016. See this link for 2012 and this link for 2014 ). To backup and restore the SSISDB database, you’ll need to know the password used for encryption when you initially created the SSIS Catalog. The script I created to restore my SQL Server 2016 SP1 Catalog test instance is appended to this post . Feel free to copy, paste, and edit. But again, you must have the password used to create the original SSIS Catalog .
Fix #2
You can use SSIS Catalog Compare to generate scripts and ISPAC files from your Production instance of the SSIS Catalog, execute the scripts and ISPAC files in the prescribed order on your QA server, and be on your merry way. If your updates reside in a folder (or folders), you can opt to script the contents of a single folder thus:

If you desire to migrate the contents of an entire SSIS Catalog instance to another instance, you can script the entire Catalog:

Either way, scripts and ISPAC files are generated inside the file system folder you select. A file system folder is created for each SSIS Catalog folder, and the contents of this file system folder are scripts and ISPAC files required to migrate your SSIS packages, projects, folder, environments, references, and parameter mappings to the SSIS Catalog of your choosing:

The scripts are named with numeric prefixes to ensure they are deployed according to SSIS Catalog precedence requirements.
Learn more about SSIS Catalog Compare here .
Andy’s Script for restoring SSISDB to SQL Server 2016 SP1As promised, here’s the script I use to restore SSISDB to a SQL Server 2016 SP1 instance:
/*
My script for restoring SSISDB to a SQL Server 2016 SP1 instance of SQL Server.
I followed the instructions found at
https://msdn.microsoft.com/en-us/library/hh213291(v=sql.130).aspxHope this helps,
Andy Leonard
*** Action is required where you see three asterisks "***"*/
-- create the ##MS_SSISServerCleanupJobLogin## login if it does not already exist.
USE [master]GO
print '##MS_SSISServerCleanupJobLogin## login'If Not Exists(Select [name]
From sys.sql_logins
Where [name] = '##MS_SSISServerCleanupJobLogin##')
begin
print ' - Creating the ##MS_SSISServerCleanupJobLogin## login'
CREATE LOGIN [##MS_SSISServerCleanupJobLogin##] WITH PASSWORD=N'DWehrJfiRgMxEFaE=KxomUkF7fnV3poW/ZQPJ' -- *** change this, please - Andy
, DEFAULT_DATABASE=[master]
, DEFAULT_LANGUAGE=[us_english]
, CHECK_EXPIRATION=OFF
, CHECK_POLICY=OFF
print ' - ##MS_SSISServerCleanupJobLogin## login created'
end
Else
print ' - ##MS_SSISServerCleanupJobLogin## already exists.'
GO
print ''
print ' - Disabling the ##MS_SSISServerCleanupJobLogin## login'ALTER LOGIN [##MS_SSISServerCleanupJobLogin##] DISABLE
print ' - ##MS_SSISServerCleanupJobLogin## login disabled'
GO USE [master]
GO
SET ANSI_NULLS ONGO SET QUOTED_IDENTIFIER ON
GO print 'dbo.sp_ssis_startup stored procedure'
If Exists(Select s.name + '.' + p.name
From sys.procedures p
Join sys.schemas s
On s.[schema_id] = p.[schema_id]
Where s.[name] = 'dbo'
And p.name = 'sp_ssis_startup')
begin
print ' - Dropping dbo.sp_ssis_startup stored procedure'
Drop PROCEDURE [dbo].[sp_ssis_startup]
print ' - dbo.sp_ssis_startup stored procedure dropped'
end print ' - Creating dbo.sp_ssis_startup stored procedure'
go CREATE PROCEDURE [dbo].[sp_ssis_startup]
AS
SET NOCOUNT ON
/* Currently, the IS Store name is '