sql-server-2019alwayson

SQL Server Always on configuration without backup restore


The secondary server is very far from the primary server. The database size is too huge to copy over the internet. Physically copying the file to an external device and then taking it over to the secondary site, copying it back in a drive to the new server and then restore is also time consuming.

Is there a way to add the secondary server to the Always on configuration without having the need to restore the database first on the secondary server creating a blank database on secondary server to start sync?

PS Note: Secondary server configuration we need it to be read only.


Solution

  • Is there a way to add the secondary server to the Always on configuration without having the need to restore the database first on the secondary server creating a blank database on secondary server to start sync? PS Note: Secondary server configuration we need it to be read only.

    It's not clear what you're expecting as an answer.

    Firstly, a secondary AG replica is always read only.

    You can choose to add a database to an AG using Automatic Seeding, or you can add an existing database by backing up the database and its transaction log from the primary and manually restoring on the secondary.

    You can only only join a database to an availability group where its last committed LSN is within the range of the current active log.

    Either way, the database(s) you want to add to the AG will have the data copied to the secondary somehow, whether that's over the internet by using automatic seeding, manually copying backup files (the most reliable option in my experience) or by physical media.

    Last time I checked, by magic was not an option! :-)