Consider there couple of minutes of down-time and for the Log Shipping fail-over. Also, the flexibility with Log Shipping is just to make sure the LSN in-sync in both sites which can be achieved by tracking all the Log backups
In you case you need perform the following steps:
- Perform Tail-Log Backup
BACKUP ... WITH NORECOVERY, so that it will leave the database into restoring.. state, no new data would be inserted by any application
- Copy that backup into Original Primary and perform RESTORE ... WITH RECOVERY. To make LSN in-sync you may need restore other log backups prior to the Tail-log restore (if anything backups performed).
- Switch applications back to original primary - Database and applications are back to normal here
To establish Log Shipping: Manually perform a Backup at Original primary and restore with NORECOVERY at LS site to make LSN in-sync between sites. once the restore completed, you can enable the Log Shipping jobs and run them in following order:
- Backup Job at Original Primary
- Copy Job at LS Site
- Restore Job at LS Site
P.S: In case of RESTORE Job failure. You need to find LSN number that Restore job indicates in SQL Job History -> Step Details section, copy that LSN number to find the missing backup using following script (run it in LS Primary Replica). Script column of the result is the fix
Declare @LSN numeric(25,0) = 6767000003108800091; -- add your LSN here
SELECT [b].[database_name] ,
CASE WHEN Type = 'L'
Then 'RESTORE LOG '+ QUOTENAME([database_name]) +' FROM DISK=N''' + f.physical_device_name + ''' WITH NORECOVERY, REPLACE, STATS; '
WHEN Type = 'D'
Then 'RESTORE DATABASE '+ QUOTENAME([database_name]) +' FROM DISK=N''' + f.physical_device_name + ''' WITH NORECOVERY, REPLACE, STATS; '
END as Script
FROM [msdb].[dbo].[backupset] AS [b]
LEFT JOIN msdb.dbo.backupmediafamily f ON b.media_set_id = f.media_set_id
WHERE b.first_lsn = @LSN or b.last_lsn = @LSN or b.checkpoint_lsn = @LSN or b.database_backup_lsn = @LSN