Force mirroring re-sync in production database

In this article

    You have set up database mirroring and data was synchronizing as expected, but now it seems to have stopped. What do you do? 

    There is no GUI to check data in a mirror, so you must use SQL Server Management Studio to inspect the tables. Generally, it should be possible to do select * from <sometable> in both the customer table and the mirror, and get the same result.

    If you notice that some tables are not updating as expected, it might be time to force a resynchronization.

    This procedure is intended for a live system. If you want to debug mirroring in SOD, you can mock a user installing the application to trigger the Mirroring Task.

    Pre-requisites:

    • your application is registered and has been deployed to the production environment
    • you have a publically available working service
    • your application has been approved by the customer's tenant administrator

    Restart synchronization

    1. Using SQL Server Management Studio, go to the <context identifier>_mirroring database table
    2. For each table that you have identified as having a problem, set LSN  to -1 within the mirroring table.
    3. Shortly thereafter, the Mirroring Task will send an authentication request, which your client must respond to. After successful authentication, SuperOffice will begin to deliver periodic updates to your mirroring service.

    Hard reset the mirror

    1. Using SQL Server Management Studio, drop the <context identifier>_mirroring database table.
    2. Shortly thereafter (the next mirroring cycle), the Mirroring Task will send an authentication request, which your client must respond to. After successful authentication, SuperOffice will begin to deliver periodic updates to your mirroring service.