SQL Server database restore
AWS Backup restores a SQL Server database as a new database and does not overwrite an existing database. You can restore to the original instance or to an alternate registered instance. Every restore begins from a snapshot recovery point; log recovery points are never selectable as a restore entry point.
Restore paths
AWS Backup supports the following restore paths:
-
Database restore as a new database. Restores a full (and, for point-in-time recovery, differential and log) chain to the original or an alternate instance as a new, non-destructive database. You provide a name for the new database, which must be unique on the target instance. You can specify the directories for the data (.mdf and .ndf) and log (.ldf) files. The directories must already exist. If you leave them blank, AWS Backup uses the target instance's default data and log directories. If a file with the same name already exists in the target directory, AWS Backup appends a number to the new file's name, for example
MyDB_1.mdf. If you start several restores to the same host, they run one at a time. -
Point-in-time recovery from the local vault. Available for databases in the Full or Bulk-Logged recovery model.
-
Flat-file recovery. Reconstructs the native
.BAKand.TRNfiles to a directory on a registered Windows host without bringing a database online.
To restore to an alternate instance, the target instance must meet these requirements:
It runs on a host that you registered as a resource provider, with the backup agent installed.
It runs the same or a later SQL Server version than the source instance.
It has FILESTREAM enabled, if the source database uses FILESTREAM.
For a TDE-enabled database, the TDE certificate must be present on the target instance before you restore. TDE status is shown as a read-only restore reminder.
Point-in-time recovery
To recover to a point in time, you select a snapshot recovery point as the base and specify a target timestamp. AWS Backup replays the required transaction logs to reach that timestamp. You must select the base snapshot explicitly; AWS Backup does not choose it for you. Explicit selection lets you authorize the restore against a specific recovery point and lets you choose an older, clean base for corruption recovery.
Point-in-time recovery runs from the local vault only. To recover to a point in time from a cloud snapshot, copy it back to a local vault first.
For the Bulk-Logged recovery model, a transaction log that contains minimally logged operations has no valid mid-log stop point. The Allow Restore to End of Log option (off by default) controls whether the restore completes at the end of the log and reports the actual time reached, or fails with a descriptive error.
Restore with NORECOVERY
You can leave a restored database in the NORECOVERY state so that you can apply additional transaction logs manually or prepare the database to rejoin an Availability Group later. When you leave a database in NORECOVERY, the Keep Change Data Capture (CDC) option is not available.
System databases
System databases (master, msdb, and model) are discovered but filtered out of registration and are not protectable.
Restore to Amazon EC2
You can restore a SQL Server database to an Amazon EC2 instance. Install the backup agent on the Amazon EC2 instance, use a cloud backup appliance, and copy the cloud recovery point to a local vault; then restore from the local vault.
Flat-file recovery
Flat-file recovery is non-destructive. It reconstructs the native backup files to a directory on a registered Windows host without bringing a database online. Files are written to <destination>/<host>_<instance>_<database>/. If a file with the same name already exists in the destination, the recovery fails. Use an empty or dedicated directory.