FIX: Transactional replication publications can support URL type device to initialize subscriptions from backups in Azure Blob Storage in SQL Server 2017

Applies to: SQL Server 2017 Developer on WindowsSQL Server 2017 Enterprise Core on WindowsSQL Server 2017 Enterprise on Windows

Symptoms


This cumulative update adds the capability of initializing transactional replication from a backup by having a device type of URL. To use this capability, you have to specify "url" for the @backupdevicetype parameter and the location of the backup file in Azure storage for the @backupdevicename parameter when you invoke sp_addsubscription.

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. 

Resolution


This issue is fixed in the following cumulative update for SQL Server:
About cumulative updates for SQL Server:
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:

Note This hotfix feature will enable to set up the transactional replication between on-premises and Azure SQL database with @sync_type = N'initialize with backup'.

Sample:
 
BACKUP DATABASE <Published_DB> TO url='backup_file_namePath'
 
Restore DB to Subscriber:
 
IF EXISTS (SELECT * FROM master.sys.credentials WHERE name = 'storage_account_name') 
DROP CREDENTIAL [containerPath
 
-- Storage account name can be located on Azure Portal at: Storage -> Settings -> Access keys 
-- Shared access signature key can be generated at: Storage -> Settings -> Shared assess signature 

CREATE CREDENTIAL [containerPath
WITH IDENTITY = 'SHARED ACCESS SIGNATURE', SECRET = '<shared_access_signature_key_with_removed_first_?_symbol>' 
RESTORE DATABASE [<database_name>] FROM URL = 'backup_file_namePath
 
Create Subscription at the publisher by using "initialize with backup" synchronization type and specifying local backup file:
 
exec sp_addsubscription @publication = N'test_init_backup', @subscriber = N'sub_server_name', 
@destination_db = N'destination_db_name', @sync_type = N'initialize with backup',
@backupdevicetype='URL',@backupdevicename='backup_file_namePath'
 

References


Learn about the terminology that Microsoft uses to describe software updates.