I am applying log shipping to a database using Invoke-DbaDbLogShipping
, and i am following the example in the documentation. The jobs get created and the Database is restored on the secondary server instance from what it appears, yet the jobs are failing. This is what the Backup job log states:
Backing up transaction log. Primary Database: 'Test14' Log Backup File: 'C:\Users...\Documents\DB Log Shipping\Backups\Local\Test14\Test14_20210822193000.trn' Error: Could not log history/error message.(Microsoft.SqlServer.Management.LogShipping) Error: Failed to convert parameter value from a SqlGuid to a String.(System.Data) Error: Object must implement IConvertible.(mscorlib) First attempt to backup database 'Test14' to file 'C:\Users...\Documents\DB Log Shipping\Backups\Local\Test14\Test14_20210822193000.trn' failed because Cannot open backup device 'C:\Users...\Documents\DB Log Shipping\Backups\Local\Test14\Test14_20210822193000.trn
Why is it failing?
Here is my script:
$params = @{
SourceSqlInstance = $PrimaryServerInstance
DestinationSqlInstance = $SecondaryServerInstance
Database = $DatabaseName
GenerateFullBackup = $true
BackupNetworkPath = $SharedPath
BackupLocalPath = $LocalPath
CompressBackup = $true
Standby = $true
BackupScheduleFrequencyType = 'daily'
BackupScheduleFrequencyInterval = 1
CopyScheduleFrequencyType = 'daily'
CopyScheduleFrequencyInterval = 1
RestoreScheduleFrequencyType = 'daily'
RestoreScheduleFrequencyInterval = 1
CopyDestinationFolder = $TransactionLogsCopyPath
Force = $true #Ignore some errors in the parameters and assume defaults. It will also remove the any present schedules with the same name for the specific job.
}
Invoke-DbaDbLogShipping @params