Secondary database migration fails


Migration of the secondary replica of an Availability Group (AG) database fails when log backups are not created on the primary replica.

Error message

System.Data.SqlClient.SqlError: Log backup for database "DBSDML" on a secondary replica failed because a synchronization point could not be established on the primary database. Either locks could not be acquired on the primary database or the database is not operating as part of the availability replica. Check the database status in the SQL Server error log of the server instance that is hosting the current primary replica. If the primary database is participating in the availability group, retry the operation.

Corrective action

You must create log backups on the primary replica, and then perform the migrate operation.