Encrypting, backing up, and restoring a SQL Server database with EFS
The Encrypting File System (EFS) is a feature of Microsoft™ Windows™ that lets you store information on your hard disk in an encrypted format. EFS enables transparent encryption and decryption of files by using advanced, standard cryptographic algorithms. Use this method to encrypt the database file if you have SQL Server Standard Edition 2008, 2008 SP3, 2008 R2 SP2, 2012, and 2014.
Before you begin
- Chosen a service account for SQL server service that
- remains available for the lifetime of the encrypted database and its backup.
- can be used to transfer the database or its backup across the network, if needed.
Note:- The service account can be the same or different than the one you use for AppScan® Enterprise.
- Use one service account to log in to the SQL Server service and to encrypt any of the databases that are hosted through that service.
- The SQL Server service account will be referred to as 'the service account' in these instructions.
- Located the filepath of the database, if different than the default locations listed here. You will need this information for step 3. You can find the default location by opening Microsoft SQL Server Management Studio. Right-click the SQL Server that hosts the database. Click .
About this task
Procedure
Results
The DATA folder C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA (if defaults were used during Microsoft SQL Server 2014 Standard installation) will appear in green in Windows Explorer after it gets encrypted. Any databases that are added after this procedure are encrypted, including the AppScan Enterprise database created by the Server Configuration Wizard.
Backing up and restoring an EFS-encrypted database
You can move an encrypted backup database file to a network-shared location hosted on the same Windows version to preserve the file encryption. You can restore the database from any location where the encrypted database file is stored. When restoring into a SQL Server, that Server's service should be running with the service account credentials of the user who encrypted the database. However, a restored database file is NOT encrypted, so you must encrypt it using the steps in the above task.