Restore with Command-Line Interface
You can restore backup of Microsoft SQL Server databases with Veeam Plug-in using the MSSQLRecoveryManager.exe command-line tool.
To perform restore with the command-line interface, do the following:
- On the Microsoft SQL Server machine, navigate to the %PROGRAMFILES%\Veeam\Plugins\Microsoft SQL\ folder.
- Run the MSSQLRecoveryManager.exe command with the required parameters. For more information, see Configuration Parameters.
For example, to restore a Microsoft SQL Server database, use the following command:
MSSQLRecoveryManager.exe --restore --src_server="srv16" --src_instance="MSSQLSERVER" --src_database="IT" --src_backup "srv16 SQL Backup (Backup Vol 01)" --date="2022-08-17 09:03:49" --dst_instance="MSSQLSERVER" --dst_database="IT_restored" --recovery_state="recovery" --f="'IT'::'DC:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\IT.mdf'" --f="'IT_log'::C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\DATA\IT_log.ldf'" |
You can specify the following parameters for database restore with the MSSQLRecoveryManager.exe command:
Command | Description |
---|---|
--help | Shows the list of parameters for the MSSQLRecoveryManager.exe command. |
--restore | Defines the restore operation. |
--src_server | Specifies the name of the original server that contained the backed-up database. |
--src_instance | Specifies the name of the original Microsoft SQL Server instance that contained the backed-up database. |
--src_cluster | Specifies the name of the original Microsoft SQL Server cluster that contained the backed-up database. |
--src_aon | Specifies the name of the original Always On availability group that contained the backed-up database. |
--src_database | Specifies the name of the database that you want to restore. |
--src_backup | Specifies the name of the Veeam Backup & Replication job in that created the backup of the database you want to restore. |
--date | Specifies the point in time to which you want to restore the database. This parameter is optional. If you do not use this parameter, Veeam Plug-in will restore the database to the time when the latest restore point was created. |
--dst_instance | Specifies the name of the target Microsoft SQL Server instance. Starting from Veeam Backup & Replication 12 Cumulative Patch 3, the following values are possible:
where:
|
--dst_database | Specifies the name of the restored database. This parameter is optional. If you do not use this parameter, Veeam Plug-in will restore the database with its original name. If you restore the database with its original name to the original location, the original database will be overwritten. |
--recovery_state | Specifies the recovery state. Possible values:
|
--standby_file_path | Specifies the path to a standby file with uncommitted transactions. |
--f | Specifies the rules for database file mapping. Provide mapping rules in the following format: --f="'<DisplayName>'::'<TargetFileLocation>'". For example: --f="'DB'::'D:\SQLServer\Data\DB.mdf'". This parameter is optional. If you do not use this parameter, Veeam Plug-in will place database files to the same location as for the original database or the default location. |