Availability group restore and reseed

616 Views Asked by At

Is it possible to restore the database backup on the primary replica of availability group and then reseed it to the secodary replica without coppying backup files?

Preferably I need to get the script (not GUI) that does it.

So far I'm doing this

  1. Remove database from AG
  2. restore database on primary
  3. Add database to AG on primary

AG is set to automatic seeding, but after adding database to AG seeding does not happend. How is it supposed to work? Thanks for the help!

1

There are 1 best solutions below

0
On BEST ANSWER

Ok, the key was to first remove DB from secondary replica, then drop db on secondary replica. Then remove DB from AG on primary replica and then option to reseed becomes available. SQL version 2019