Skip to content

FileRestore Configuration

Randolph West edited this page Dec 20, 2016 · 1 revision

The FileStorageRestore.exe.config file includes a user-configurable section called <appSettings>, which looks similar to this:

<appSettings>
	<add key="RemotePath" value="\\SERVER\share" />
	<add key="DumpFileList" value="False" />
	<add key="DumpFile" value="C:\Temp\AzureBlobStorageDumpFile.txt" />
	<add key="DatabaseToRestore" value="name_of_database_to_restore" />
	<add key="DatabaseRestoredName" value="ABSR_name_of_database_to_restore" />
	<add key="DatabaseRestoredFilePrefix" value="_ABSR_" />
	<add key="DatabaseRestoredPath" value="C:\Temp" />
	<add key="ItemSortOrder" value="Name" />
	<add key="FetchFilesFromRemoteStorage" value="False" />
	<add key="LocalPath" value="C:\SQLData\Backup" />
	<add key="RestoreScriptFile" value="C:\Temp\ABSRestore_{%%DATABASE%%}_{%%MASK%%}.sql" />
	<add key="RestoreScriptMask" value="yyyyMMdd_HHmmss" />
	<add key="StopAtDateTime" value="20161130_143109" />
	<add key="StopAtEnabled" value="False" />
</appSettings>

RemotePath

This is the UNC path (in the format \\SERVER\share) of the file share where your backup files are stored. You should ensure that the username and password for this UNC path are configured in the connections.config file.

DumpFileList

To see a list of all files stored in Remote Storage, without having to download anything, set this value to True, and make sure the DumpFile setting contains a valid value.

If this value is set to True, the Restore tool will save the list of files to the text file specified in the DumpFile value and then quit, without downloading any files or creating a restore script.

If this value is set to False, the Restore tool will ignore the value in DumpFile, and continue with the restore process.

DumpFile

This is the location for a text file to be created, containing a list of all files stored in Remote Storage. This value will also accept a UNC path. This value will be ignored if the DumpFileList value is False.

DatabaseToRestore

This is the name of the database you are restoring from Remote Storage. Do not escape the name with quoted identifiers. For example, if your database is called MyBackup, use MyBackup in this value, and not [MyBackup].

The Restore tool will iterate through every file in the UNC path, searching for file names containing this value.

If you have used Ola Hallengren's Maintenance Solution to create your backups, these files will be parsed easily.

DatabaseRestoredName

The new name of the database to restore, once the backup files for DatabaseToRestore have been downloaded.

The Restore tool generates a script to restore your database (specified in DatabaseToRestore) from Remote Storage. This script is destructive, in that it will overwrite any existing database on the instance which has the same name as this value.

It is recommended to keep the ABSR_ prefix when setting this value, to ensure that no existing database is overwritten.

For example, if the database you are restoring is called MyBackup, this value should be set to ABSR_MyBackup.

DatabaseRestoredFilePrefix

Adds a prefix to restored data and log files.

To prevent overwriting any existing data or log files on your local file system, this value will create the files with the specified prefix.

For example, if your data file was called MyBackup.mdf, the restored file name will be _ABSR_MyBackup.mdf. If your log file was called MyBackup_log.ldf, the restored file name will be _ABSR_MyBackup_log.ldf.

It is recommended to leave this value as-is.

DatabaseRestoredPath

The location of the restored data and log files, once the database has been restored.

There is no way to know, without viewing the file header of the full backup file, how many data files are being restored. Therefore, please ensure that this path contains sufficient space to restore the backup.

FetchFilesFromRemoteStorage

This is a boolean setting which, if True, will download all files from Remote Storage that do not exist on the local storage path, as specified in LocalPath.

This setting is useful when migrating to a new server, to allow downloading the entire UNC path's contents.

LocalPath

The location of the downloaded files, that will be restored to your on-premises SQL Server.

The Restore tool will search for the latest Full Backup for the DatabaseToRestore, followed by zero or one Differential Backup(s), and zero or more Transaction Log Backups. If it finds a match, these files will be downloaded to the LocalPath. Any existing folder structure will be maintained.

Please ensure that this path contains sufficient space to save the downloaded files.

RestoreScriptFile

The name of the T-SQL restore script generated by the Restore tool, once all the requisite files have been downloaded to LocalPath.

This restore script will make use of the above settings to generate a valid restore script. Please ensure that all necessary paths are correct, and that there is sufficient storage to run the restore.

Because there is no way to know how many data and log files are contained in a SQL Server backup until the restore script runs, the DatabaseRestoredPath must have sufficient space to run the restore.

RestoreScriptMask

This value is used by the RestoreScriptFile setting, to create the name of the file using the provided naming convention.

It is recommended to leave this value as-is.

###StopAtEnabled

This is a boolean setting which, if True, will require a value in the StopAtDateTime setting to be configured.

When True, the T-SQL Restore Script will include the STOPAT parameter, allowing an exact point-in-time database recovery.

Any transaction log files that are dated after the StopAtDateTime value, will not be downloaded, which could save bandwidth and time.

###StopAtDateTime

A value in the same format as the RestoreScriptMask, this will be used if StopAtEnabled is set to True.