I have SQL Server availability group with manual seeding and two synchronous replicas - primary and secondary.
I want to onboard a set of database backups onto the availability group : 1 full backup + 1 transaction log backup.
Backups are large, so I restore to primary and secondary in parallel. Is this officially supported ?
This is what I do:
- Restore the backup on the primary and the secondary in parallel:
-- On primary:
RESTORE DATABASE [somedb] FROM DISK = '/var/opt/mssql/data/20260712-231800-full.bak' WITH NORECOVERY;
RESTORE LOG [somedb] FROM DISK = '/var/opt/mssql/data/20260712-232000-log.bak' WITH NORECOVERY, STOPAT = '2026-07-12 23:19:59.000';
RESTORE DATABASE [somedb] WITH RECOVERY;
-- On secondary:
RESTORE DATABASE [somedb] FROM DISK = '/var/opt/mssql/data/20260712-231800-full.bak' WITH NORECOVERY;
RESTORE LOG [somedb] FROM DISK = '/var/opt/mssql/data/20260712-232000-log.bak' WITH NORECOVERY, STOPAT = '2026-07-12 23:19:59.000';
- On the primary, take one final log backup:
BACKUP LOG [somedb] TO DISK = '/var/opt/mssql/data/final-log.bak';
- On the secondary, restore the final log backup from the primary:
RESTORE LOG [somedb] FROM DISK = '/var/opt/mssql/data/final-log.bak' WITH NORECOVERY;
- On the primary, add the database to the availability group:
ALTER AVAILABILITY GROUP [someag] ADD DATABASE somedb;
- On the secondary, join the database to the availability group:
ALTER DATABASE [somedb] SET HADR AVAILABILITY GROUP = [someag];
If I do not take a final log backup on the primary, for most databases it works fine, but for certain backups, the secondary fails to join the database to AG:
Msg 1478, Level 16, State 101, Server node-1, Line 1
The mirror database, "somedb", has insufficient transaction log data to preserve the log backup chain of the principal database.
This may happen if a log backup from the principal database has not been taken or has not been restored on the mirror database.
Could an expert confirm if the above steps are the correct way to restore in parallel to replicas of availability group with manual seeding ?