Set-ZrSiteReplication
Configures a single store's site role, mode, and merge policy directly, without touching any peer — the low-level, one-side primitive behind New-ZrSiteLink.
Syntax
Set-ZrSiteReplication
[-Store] <string>
[-SiteId <string>] [-Label <string>]
[-Role <SiteRole>] [-Mode <SiteMode>] [-MergePolicy <MergePolicy>]
[-HomeSitePrefixes <string[]>] [-Restart]
[-Managers <string[]>] [-Port <int>] [-Token <string>] [-TimeoutSec <int>]
[-WhatIf] [-Confirm]
Description
Set-ZrSiteReplication sets this store's site id, role, mode, merge policy, and home-site prefixes on each of its nodes, enabling site replication for the store. It is the one-sided form of New-ZrSiteLink: it does not configure or contact a peer. Existing peers are preserved — this is a role/mode edit, not a re-pairing — so use it to flip a site's role (for example, promote a passive mirror to active during failover) rather than to establish a new link. To pair two stores in one call, use New-ZrSiteLink instead.
The cmdlet applies the change to each resolved manager, prints a per-manager result, emits a StoreSiteApplyResult, and supports -WhatIf/-Confirm.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
-Store | string | Yes | The store to configure. Position 0. |
-SiteId | string | No | Site id for the store. |
-Label | string | No | Cosmetic display label for the site. |
-Role | SiteRole | No | Active (default) serves reads/writes and exposes a change feed; Passive mirrors a peer's change feed and refuses application writes. |
-Mode | SiteMode | No | ActivePassive (default) or ActiveActive. |
-MergePolicy | MergePolicy | No | Conflict convergence. LastWriterWins (default, HLC). |
-HomeSitePrefixes | string[] | No | Key prefixes homed to this site. |
-Restart | switch | No | Rolling-restart each running node so it picks up the change immediately. |
-Managers | string[] | No | Management Service endpoints to target. When omitted, the active workspace's managers are used. |
-Port | int | No | Management Service port for bare-host managers. Default 7801. |
-Token | string | No | Admin bearer token for authenticated control-plane calls. |
-TimeoutSec | int | No | Per-request timeout in seconds. Default 30. |
Supports -WhatIf and -Confirm.
Examples
Promote a store's local site to active during a failover, applying it immediately.
Set-ZrSiteReplication -Store orders -Role Active -Mode ActivePassive -Restart