I have two instances on my laptop, Default instance and Instance1.
In the default instance, I have enabled TDE.
Im now trying to restore a backup of a TDE Database from default instance to Instance1.
First, I backed up the ServiceMasterKey:
BACKUP SERVICE MASTER KEY TO FILE = 'C:\SQLServerFiles\TDE\serviceMasterKey'
ENCRYPTION BY PASSWORD = 'Password1'
I then opened a session on instance2, in the master database, and ran the following code:
--restore TDE Encrypted database to new instance
RESTORE SERVICE MASTER KEY FROM FILE = 'C:\SQLServerFiles\TDE\serviceMasterKey'
DECRYPTION BY PASSWORD = 'Password1'
When i run this i get the following error:
Msg 15317, Level 16, State 2, Line 1
The master key file does not exist or has invalid format.
I know the key is not corrupt as if i try to restore it onto the default instance i get the message:
The old and new master keys are identical. No data re-encryption is required
Am i missing a step to restore the Service Master Key to the Instance2?