Restoring an Encrypted Database - SQL Server

Overview

This article explains the extra steps you need to take when restoring an encrypted database. You MUST have the password for the master key in order to do this.

Procedure

After restoring your BAK file, run the following script against the encrypted database, using the password for your master key,

OPEN MASTER KEY DECRYPTION BY PASSWORD = 'MyPassword'
go
ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY
go
close master key
go