Restore backup in parallel to primary and secondary of availability group with manual seeding

dekp 20 Reputation points
2026-07-17T13:47:06.5466667+00:00

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:

  1. 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';
  1. On the primary, take one final log backup:
BACKUP LOG [somedb] TO DISK = '/var/opt/mssql/data/final-log.bak';
  1. 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;
  1. On the primary, add the database to the availability group:
ALTER AVAILABILITY GROUP [someag] ADD DATABASE somedb;
  1. 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 ?

SQL Server Database Engine
0 comments No comments

Answer accepted by question author
Erland Sommarskog 137.4K Reputation points MVP Volunteer Moderator
2026-07-18T10:28:15.7833333+00:00

First: While I can claim expertise in SQL Server in some regards, I'm not really there when it comes to availability groups, since I am in a developer role, and don't work as a DBA.

That said, I think your scheme is OK. The normal way to go when setting up an AG with manual seeding is to take a full backup and then use that for the seeding process, but full + log should work as well. But no matter what, you need that extra backup of the log of the primary, because when you run WITH RECOVERY, this could roll forward transactions that causes new log records to be written. There are also internal operations that could generate log records, for instance clean up of Query Store, automatic cleanup of temporary tables.

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

0 additional answers

Sort by: Oldest

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.