Skip to content

Basic Config Options

David Wiseman edited this page Apr 23, 2024 · 6 revisions

Destination

A connection string for the server where you want the log files to be restored.

LogShippingService.exe --Destination "Data Source=LOCALHOST;Integrated Security=True;Encrypt=True;Trust Server Certificate=True"

  "Config": {
    "Destination": "Data Source=LOCALHOST;Integrated Security=True;Encrypt=True;Trust Server Certificate=True",

⚠️It's recommended to use Windows authentication as this is not encrypted.

LogFilePath

The path where your transaction log backups are located. This should have a {DatabaseName} token which will be replaced by the name of the database. The service will run the GetDatabases query to get a list of databases that are in a restoring or standby state. It will loop through each database looking for log backups that have occurred since the last restore. The {DatabaseName} token is replaced with the name of the database been restored.

LogShippingService.exe --LogFilePath "\\BACKUPSERVER\Backups\\ERVERNAME\{DatabaseName}\LOG"

  "Config": {
    "LogFilePath": "\\\\BACKUPSERVER\\Backups\\SERVERNAME\\{DatabaseName}\\LOG",

Azure blob

Restores are also supported from Azure blob containers. In this case you will need to specify ContainerUrl and SASToken.

LogShippingService.exe --ContainerUrl "https://your_storage_account.blob.core.windows.net/your_container_name" --SASToken "?sp=..." --LogFilePath "LOG/SERVERNAME/{DatabaseName}/"

  "Config": {
    "ContainerUrl": "https://your_storage_account.blob.core.windows.net/your_container_name",
    "SASToken": "?sp=...",
    "LogFilePath": "LOG/SERVERNAME/{DatabaseName}/"

🔐 The SASToken value will be encrypted with the machine key. If you edit the config file directly, the encryption will be performed when the service starts.

S3

If you are on SQL Server 2022, S3 is also supported:

LogShippingService.exe --LogFilePath "s3://<bucket>.s3.<region>.amazonaws.com/BackupFolder/{DatabaseName}/LOG" --AccessKey "your_access_key" --SecretKey "your_secret_key"

🔐 You can omit the Access/SecretKey if you are able to use instance profile for bucket access. The SecretKey value will be encrypted with the machine key.

Clone this wiki locally