Skip to content

Commit 1784f3b

Browse files
authored
Update replication documentation for nondefault ports and known issues (#36549)
1 parent 08dc2cd commit 1784f3b

5 files changed

Lines changed: 95 additions & 39 deletions

File tree

docs/linux/sql-server-linux-replication-non-default-ports.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
---
2-
title: "Configure Replication Snapshot Folder (Non-Default Ports)"
2+
title: "Configure Replication Snapshot Folder (Nondefault Ports)"
33
titleSuffix: SQL Server on Linux
4-
description: Learn to configure snapshot folder shares with non-default ports for SQL Server replication on Linux.
4+
description: Learn to configure snapshot folder shares with nondefault ports for SQL Server replication on Linux.
55
author: rwestMSFT
66
ms.author: randolphwest
77
ms.reviewer: vanto
88
ms.date: 01/21/2025
9+
ai-usage: ai-assisted
910
ms.service: sql
1011
ms.subservice: linux
1112
ms.topic: how-to
1213
ms.custom:
1314
- linux-related-content
1415
monikerRange: ">=sql-server-ver15 || >=sql-server-linux-ver15"
1516
---
16-
# Configure replication with non-default ports (SQL Server Linux)
17+
# Configure replication with nondefault ports (SQL Server Linux)
1718

1819
[!INCLUDE [SQL Server - Linux](../includes/applies-to-version/sql-linux.md)]
1920

2021
You can configure replication with SQL Server on Linux instances listening on any port configured with the `network.tcpport` mssql-conf setting. The port needs to be appended to the server name during configuration if the following conditions are true:
2122

2223
- Replication set-up involves an instance of SQL Server on Linux
23-
- Any instance (Windows or Linux) is listening on a non-default port.
24+
- Any instance (Windows or Linux) is listening on a nondefault port.
2425

2526
The server name of an instance can be found by running `@@SERVERNAME` on the instance. Don't use the IP address instead of the server name. Using the IP address for the publisher, distributor, or subscriber might result in an error.
2627

2728
> [!NOTE]
28-
> Creating SQL Server replication on Linux with non-default port will only work with SQL Server 2019 and above.
29+
> Creating SQL Server replication on Linux with nondefault port will only work with SQL Server 2019 and above.
2930
3031
## Examples
3132

@@ -53,6 +54,14 @@ EXEC sp_addsubscription @subscriber = 'Server2,6549' , ,
5354
EXEC sp_addsubscription @subscriber = 'Server3/MSSQL2017,6549', ,
5455
```
5556

57+
## Known issues
58+
59+
### Linked server port not updated when recreating subscription
60+
61+
When you delete and recreate a subscription with a nondefault port on the Subscriber, the system reuses the existing linked server but fails to update the port configuration. This can cause replication to fail when attempting to connect to the Subscriber.
62+
63+
For more information about this known issue, including symptoms, cause, and workaround, see [Delete a push subscription](../relational-databases/replication/delete-a-push-subscription.md#known-issue-port).
64+
5665
## Related content
5766

5867
- [SQL Server replication on Linux](sql-server-linux-replication.md)

docs/relational-databases/replication/create-a-push-subscription.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ title: "Create a push subscription"
33
description: Learn how to create a push subscription in SQL Server by using SQL Server Management Studio, Transact-SQL, or Replication Management Objects.
44
author: "MashaMSFT"
55
ms.author: "mathoma"
6-
ms.date: 09/25/2024
6+
ms.date: 02/03/2026
7+
ai-usage: ai-assisted
78
ms.service: sql
89
ms.subservice: replication
910
ms.topic: how-to
@@ -15,10 +16,10 @@ helpviewer_keywords:
1516
- "subscriptions [SQL Server replication], push"
1617
- "snapshot replication [SQL Server], subscribing"
1718
- "transactional replication, subscribing"
18-
monikerRange: "=azuresqldb-current||>=sql-server-2016"
19+
monikerRange: "=azuresqldb-mi-current||=azuresqldb-current||>=sql-server-2016"
1920
---
2021
# Create a push subscription
21-
[!INCLUDE[sql-asdb](../../includes/applies-to-version/sql-asdb.md)]
22+
[!INCLUDE[sql-asdb-asdbmi](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
2223
This topic describes how to create a push subscription in [!INCLUDE[ssnoversion](../../includes/ssnoversion-md.md)] by using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)], [!INCLUDE[tsql](../../includes/tsql-md.md)], or Replication Management Objects (RMO). For information about creating a push subscription for a non- [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] Subscriber, see [Create a subscription for a non-SQL Server Subscriber](../../relational-databases/replication/create-a-subscription-for-a-non-sql-server-subscriber.md).
2324

2425
[!INCLUDE[azure-sql-db-replication-supportability-note](../../includes/azure-sql-db-replication-supportability-note.md)]
@@ -241,19 +242,18 @@ You can create push subscriptions programmatically by using replication stored p
241242
### <a name="PShellExample"></a> Examples (RMO)
242243
This example creates a new push subscription to a transactional publication. The Windows account credentials that you use to run the Distribution Agent job are passed at runtime.
243244

244-
[!code-cs[HowTo#rmo_CreateTranPushSub](../../relational-databases/replication/codesnippet/csharp/rmohowto/rmotestevelope.cs#rmo_createtranpushsub)]
245-
246-
[!code-vb[HowTo#rmo_vb_CreateTranPushSub](../../relational-databases/replication/codesnippet/visualbasic/rmohowtovb/rmotestenv.vb#rmo_vb_createtranpushsub)]
247-
248-
This example creates a new push subscription to a merge publication. The Windows account credentials that you use to run the Merge Agent job are passed at runtime.
249-
250-
[!code-cs[HowTo#rmo_CreateMergePushSub](../../relational-databases/replication/codesnippet/csharp/rmohowto/rmotestevelope.cs#rmo_createmergepushsub)]
251-
252-
[!code-vb[HowTo#rmo_vb_CreateMergePushSub](../../relational-databases/replication/codesnippet/visualbasic/rmohowtovb/rmotestenv.vb#rmo_vb_createmergepushsub)]
245+
:::code language="csharp" source="../../relational-databases/replication/codesnippet/csharp/rmohowto/rmotestevelope.cs" range="rmo_createtranpushsub":::
246+
247+
:::code language="vb" source="../../relational-databases/replication/codesnippet/visualbasic/rmohowtovb/rmotestenv.vb" range="rmo_vb_createtranpushsub":::
253248

249+
:::code language="csharp" source="../../relational-databases/replication/codesnippet/csharp/rmohowto/rmotestevelope.cs" range="rmo_createmergepushsub":::
250+
251+
:::code language="vb" source="../../relational-databases/replication/codesnippet/visualbasic/rmohowtovb/rmotestenv.vb" range="rmo_vb_createmergepushsub":::
252+
254253
## Related content
255254

256255
- [View and modify push subscription properties](../../relational-databases/replication/view-and-modify-push-subscription-properties.md)
256+
- [Delete a push subscription](../../relational-databases/replication/delete-a-push-subscription.md)
257257
- [Replication security best practices](../../relational-databases/replication/security/replication-security-best-practices.md)
258258
- [Create a publication](../../relational-databases/replication/publish/create-a-publication.md)
259259
- [Replication management objects concepts](../../relational-databases/replication/concepts/replication-management-objects-concepts.md)

docs/relational-databases/replication/delete-a-pull-subscription.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ title: "Delete a Pull Subscription"
33
description: "Delete a Pull Subscription"
44
author: "MashaMSFT"
55
ms.author: "mathoma"
6-
ms.date: 09/25/2024
6+
ms.date: 02/03/2026
7+
ai-usage: ai-assisted
78
ms.service: sql
89
ms.subservice: replication
910
ms.topic: how-to
@@ -14,10 +15,10 @@ helpviewer_keywords:
1415
- "deleting subscriptions"
1516
- "pull subscriptions [SQL Server replication], deleting"
1617
- "subscriptions [SQL Server replication], pull"
17-
monikerRange: "=azuresqldb-mi-current||>=sql-server-2016"
18+
monikerRange: "=azuresqldb-mi-current||=azuresqldb-current||>=sql-server-2016"
1819
---
1920
# Delete a Pull Subscription
20-
[!INCLUDE [SQL Server SQL MI](../../includes/applies-to-version/sql-asdbmi.md)]
21+
[!INCLUDE[sql-asdb-asdbmi](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
2122
This topic describes how to delete a pull subscription in [!INCLUDE[ssnoversion](../../includes/ssnoversion-md.md)] by using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)], [!INCLUDE[tsql](../../includes/tsql-md.md)], or Replication Management Objects (RMO).
2223

2324
**In This Topic**
@@ -31,7 +32,10 @@ monikerRange: "=azuresqldb-mi-current||>=sql-server-2016"
3132
[Replication Management Objects (RMO)](#RMOProcedure)
3233

3334
## <a name="SSMSProcedure"></a> Using SQL Server Management Studio
34-
Delete a pull subscription at the Publisher (from the **Local Publications** folder in [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)]) or the Subscriber (from the **Local Subscriptions** folder). Deleting a subscription does not remove objects or data from the subscription; they must be removed manually.
35+
Delete a pull subscription at the Publisher (from the **Local Publications** folder in [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)]) or the Subscriber (from the **Local Subscriptions** folder). Deleting a subscription does not remove objects or data from the subscription; they must be removed manually.
36+
37+
> [!NOTE]
38+
> For information about a known issue that affects push subscriptions when using non-default ports, see [Delete a push subscription](../../relational-databases/replication/delete-a-push-subscription.md#known-issue-port).
3539
3640
#### To delete a pull subscription at the Publisher
3741

@@ -121,16 +125,14 @@ monikerRange: "=azuresqldb-mi-current||>=sql-server-2016"
121125
### <a name="PShellExample"></a> Examples (RMO)
122126
This example deletes a pull subscription to a transactional publication and removes the subscription registration at the Publisher.
123127

124-
[!code-cs[HowTo#rmo_DropTranPullSub](../../relational-databases/replication/codesnippet/csharp/rmohowto/rmotestevelope.cs#rmo_droptranpullsub)]
125-
126-
[!code-vb[HowTo#rmo_vb_DropTranPullSub](../../relational-databases/replication/codesnippet/visualbasic/rmohowtovb/rmotestenv.vb#rmo_vb_droptranpullsub)]
127-
128-
This example deletes a pull subscription to a merge publication and removes the subscription registration at the Publisher.
129-
130-
[!code-cs[HowTo#rmo_DropMergePullSub](../../relational-databases/replication/codesnippet/csharp/rmohowto/rmotestevelope.cs#rmo_dropmergepullsub)]
131-
132-
[!code-vb[HowTo#rmo_vb_DropMergePullSub](../../relational-databases/replication/codesnippet/visualbasic/rmohowtovb/rmotestenv.vb#rmo_vb_dropmergepullsub)]
128+
:::code language="csharp" source="../../relational-databases/replication/codesnippet/csharp/rmohowto/rmotestevelope.cs" range="rmo_droptranpullsub":::
129+
130+
:::code language="vb" source="../../relational-databases/replication/codesnippet/visualbasic/rmohowtovb/rmotestenv.vb" range="rmo_vb_droptranpullsub":::
133131

132+
:::code language="csharp" source="../../relational-databases/replication/codesnippet/csharp/rmohowto/rmotestevelope.cs" range="rmo_dropmergepullsub":::
133+
134+
:::code language="vb" source="../../relational-databases/replication/codesnippet/visualbasic/rmohowtovb/rmotestenv.vb" range="rmo_vb_dropmergepullsub":::
135+
134136
## Related content
135137

136138
- [Subscribe to Publications](../../relational-databases/replication/subscribe-to-publications.md)

docs/relational-databases/replication/delete-a-push-subscription.md

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ title: "Delete a Push Subscription"
33
description: Learn how to delete a push subscription in SQL Server by using SQL Server Management Studio, Transact-SQL, or Replication Management Objects.
44
author: "MashaMSFT"
55
ms.author: "mathoma"
6-
ms.date: 09/25/2024
6+
ms.date: 02/03/2026
7+
ai-usage: ai-assisted
78
ms.service: sql
89
ms.subservice: replication
910
ms.topic: how-to
@@ -14,10 +15,10 @@ helpviewer_keywords:
1415
- "push subscriptions [SQL Server replication], deleting"
1516
- "deleting subscriptions"
1617
- "subscriptions [SQL Server replication], push"
17-
monikerRange: "=azuresqldb-current||>=sql-server-2016"
18+
monikerRange: "=azuresqldb-mi-current||=azuresqldb-current||>=sql-server-2016"
1819
---
1920
# Delete a Push Subscription
20-
[!INCLUDE[sql-asdb](../../includes/applies-to-version/sql-asdb.md)]
21+
[!INCLUDE[sql-asdb-asdbmi](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
2122
This topic describes how to delete a push subscription in [!INCLUDE[ssnoversion](../../includes/ssnoversion-md.md)] by using [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)], [!INCLUDE[tsql](../../includes/tsql-md.md)], or Replication Management Objects (RMO).
2223

2324
**In This Topic**
@@ -29,6 +30,10 @@ monikerRange: "=azuresqldb-current||>=sql-server-2016"
2930
[Transact-SQL](#TsqlProcedure)
3031

3132
[Replication Management Objects (RMO)](#RMOProcedure)
33+
34+
- **Known issues:**
35+
36+
[Linked server port not updated when recreating subscription](#known-issue-port)
3237

3338
## <a name="SSMSProcedure"></a> Using SQL Server Management Studio
3439
Delete a push subscription at the Publisher (from the **Local Publications** folder in [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)]) or the Subscriber (from the **Local Subscriptions** folder). Deleting a subscription does not remove objects or data from the subscription; they must be removed manually.
@@ -54,6 +59,41 @@ monikerRange: "=azuresqldb-current||>=sql-server-2016"
5459
3. Right-click the subscription you want to delete, and then click **Delete**.
5560

5661
4. In the confirmation dialog box, select whether to connect to the Publisher to delete subscription information. If you clear the **Connect to Publisher** check box, you should connect to the Publisher later to delete the information.
62+
63+
## <a name="known-issue-port"></a> Known issue: Linked server port not updated when recreating subscription
64+
65+
When you delete and recreate a subscription with a nondefault port on the Subscriber, the system reuses the existing linked server but fails to update the port configuration. This can cause replication to fail when attempting to connect to the Subscriber.
66+
67+
**Applies to:** SQL Server (all versions including Linux), Azure SQL Managed Instance, Azure SQL Database (as Subscriber)
68+
69+
### Symptoms
70+
71+
After following these steps, data changes on the Publisher fail to replicate to the Subscriber:
72+
73+
1. Create a subscription with a non-default port specified for the Subscriber (for example, `MySubscriber,1450`)
74+
2. Delete the subscription using `sp_dropsubscription`
75+
3. Recreate the subscription with a different port (for example, `MySubscriber,1455`)
76+
4. Publisher attempts to connect using the original port (1450) instead of the new port (1455)
77+
78+
### Cause
79+
80+
When you delete a subscription using `sp_dropsubscription`, the linked server to the Subscriber isn't deleted. When you recreate the subscription with a different port, the system reuses the existing linked server but doesn't update the port configuration.
81+
82+
### Workaround
83+
84+
Manually delete the linked server to the Subscriber after deleting the subscription and before recreating it:
85+
86+
```sql
87+
-- After running sp_dropsubscription
88+
-- Delete the linked server manually
89+
EXEC sp_dropserver @server = 'MySubscriber', @droplogins = 'droplogins';
90+
91+
-- Now you can recreate the subscription with a different port
92+
-- The system will create a new linked server with the correct port
93+
```
94+
95+
> [!IMPORTANT]
96+
> Ensure no other subscriptions or processes are using the linked server before deleting it.
5797
5898
## <a name="TsqlProcedure"></a> Using Transact-SQL
5999
Push subscriptions can be deleted programmatically using replication stored procedures. The stored procedures used depend on the type of publication to which the subscription belongs.
@@ -113,10 +153,10 @@ monikerRange: "=azuresqldb-current||>=sql-server-2016"
113153
### <a name="PShellExample"></a> Examples (RMO)
114154
You can delete push subscriptions programmatically by using Replication Management Objects (RMO).
115155

116-
[!code-cs[HowTo#rmo_DropTranPushSub](../../relational-databases/replication/codesnippet/csharp/rmohowto/rmotestevelope.cs#rmo_droptranpushsub)]
117-
118-
[!code-vb[HowTo#rmo_vb_DropTranPushSub](../../relational-databases/replication/codesnippet/visualbasic/rmohowtovb/rmotestenv.vb#rmo_vb_droptranpushsub)]
119-
156+
:::code language="csharp" source="../../relational-databases/replication/codesnippet/csharp/rmohowto/rmotestevelope.cs" range="rmo_droptranpushsub":::
157+
158+
:::code language="vb" source="../../relational-databases/replication/codesnippet/visualbasic/rmohowtovb/rmotestenv.vb" range="rmo_vb_droptranpushsub":::
159+
120160
## Related content
121161

122162
- [Subscribe to Publications](../../relational-databases/replication/subscribe-to-publications.md)

docs/relational-databases/replication/login-for-updatable-subscriptions.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@ title: "Login for Updatable Subscriptions"
33
description: "Login for Updatable Subscriptions"
44
author: "MashaMSFT"
55
ms.author: "mathoma"
6-
ms.date: 09/25/2024
6+
ms.date: 02/03/2026
7+
ai-usage: ai-assisted
78
ms.service: sql
89
ms.subservice: replication
910
ms.topic: ui-reference
1011
ms.custom:
1112
- updatefrequency5
1213
f1_keywords:
1314
- "sql13.rep.newsubwizard.updatablesubscriptionslogin.f1"
15+
monikerRange: "=azuresqldb-mi-current||=azuresqldb-current||>=sql-server-2016"
1416
---
1517
# Login for Updatable Subscriptions
16-
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
18+
[!INCLUDE[sql-asdb-asdbmi](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
1719
For immediate update, if you selected **Replicate** on the **Updatable Subscriptions** page of this wizard, you must specify an account with the Subscriber under which connections to the Publisher are made.
1820

1921
Connections are used by the triggers that fire at the Subscriber, and propagate changes to the Publisher. This account is required even if you selected **Queue changes and commit when possible** on the **Updatable Subscriptions** page. The New Subscription Wizard by default configures queued updating with the ability to switch to immediate updating if required.
@@ -43,6 +45,9 @@ f1_keywords:
4345

4446
**Use a linked server or remote server that you have already defined.**
4547
This option requires a linked server or remote server that you have already defined. For more information, see [Linked Servers &#40;Database Engine&#41;](../../relational-databases/linked-servers/linked-servers-database-engine.md) and [Remote Servers](../../database-engine/configure-windows/remote-servers.md). Ensure that the login used for the linked server or remote server has a strong password and has only the permissions described in this topic.
48+
49+
> [!NOTE]
50+
> If you're using non-default ports for your Subscriber and need to recreate a subscription, manually delete the linked server after deleting the subscription. For more information about this known issue, see [Delete a push subscription](../../relational-databases/replication/delete-a-push-subscription.md#known-issue-port).
4651
4752
## Related content
4853

0 commit comments

Comments
 (0)