We are restoring a development database from a backup of our production database. This database is encrypted. Once the database is restored errors are generated on attempts to open the symmetric key. The code that raises the error is OPEN SYMMETRIC KEY <key> DECRYPTION BY CERTIFICATE <certificate>
The error generated isMsg 15466, Level 16, State 1, Line 1An error occurred during decryption.
The server key, master key and certificate were created the same on all environments. Once the backup file was restored to dev, the following statements where executed: USE [<database>];GOOPEN MASTER KEY DECRYPTION BY PASSWORD = <password>;ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY;CLOSE MASTER KEY;GO
This concept appeared to work just fine during the development and testing stages but not in actual practice. Any suggestions?Production EnvironmentA 2 node active/passive failover SQL Server cluster – Windows Server 2003 Enterprise Edition SP2, SQL Server 2005 Enterprise Edition SP2 (9.00.3042.00) - 32 bit.Development EnvironmentA standalone SQL Server database server - Windows Server 2003 Standard Edition SP2, SQL Server 2005 Developer Edition SP2 (9.00.3042.00) - 32 bit.