# Review a cold jurisdiction failover

Source: https://docs.imprezahost.com/jurisdiction-failover.html

**Availability:** jurisdiction failover is available for managed hostnames with the reviewed **Memos 0.31.0** and **Uptime Kuma 2.5.5** catalog apps and, since 11 October 2026, for **custom projects** (image, git and Compose) that pin their source and declare their data, as a cold standby that you review and confirm. Other catalog apps follow only after their own data-copy review. Managed VPS ownership checks recognize a normalized public IPv4 or IPv6 address belonging to the same service on the account. IPv6 country attestation must match that Agent and an address assigned to its own service; all country, compatibility and freshness checks still apply. If the operator turns the feature off, its REST routes return 404, hosted MCP stops offering its tools and My Apps hides the panel; an already accepted cutover still completes.

A cold standby is a second application on another server you own, in a different reported country. You review the proposed change and explicitly confirm it. The source writer is fenced before the restored standby takes the managed hostname. A cold copy can lose everything written since its backup; preparation and a successful drill do not promise zero data loss.

## Before you start

- Keep two compatible applications and enough capacity on two owned servers in different countries. Pairing does not order a server, create a restore or change billing.
- Use the managed HTTPS hostname of the current primary. A primary with only a `.onion` address cannot be paired yet: pairing returns HTTP 422 `PRIMARY_HOSTNAME_REQUIRED` and requires a hostname in the managed zone. The standby must be running without a public hostname or onion route before pairing. A supported public onion can accompany the managed hostname; private onions with authorized clients are excluded.
- The ordinary pair operation accepts applications without live service bindings. A database stack requires its separately supported paired-provider workflow; this operation does not migrate an arbitrary database, external database or another binding. Do not treat a compatible-looking recipe as proof that a stack is supported.
- Managed VPS countries are derived from the server inventory and checked against the active owned service and agent. An external server's country is declared by you, **not verified by Impreza**; a changed agent address requires a new declaration. A dedicated server requires a mapped or explicitly attested provider location. An unmapped location must be resolved before pairing.
- In My Apps, use an account with the required app-management permission. REST and hosted MCP require an account credential without resource confinement. Reading uses `read`; pairing and preparing use `deploy`; sync confirmation, application, retry, retirement and drills use `manage`.

Suspended or abuse-blocked services are ineligible. A jurisdiction label does not establish where a customer, visitor, backup provider or legal obligation is located. Review applicable service terms separately.

## Create the standby

This creation option requires the operator's jurisdiction failover switch. The
reviewed catalog builds are **Memos 0.31.0** and **Uptime Kuma 2.5.5**. Both sides
must use the same app and reviewed version. Other builds are refused; upgrading
the catalog requires another standby recipe review.

In **My Apps**, select Memos or Uptime Kuma, choose **Create a cold standby** in
the install dialog, then select your second server in a different country. This
works in Simple and Advanced mode. The option disables the domain and onion
fields. Do not enter a domain, enable an onion, or request an onion import. Wait
for the healthy deployment before pairing. The copy has no public route; pairing
and restoration are separate steps and do not populate its data automatically.

With MCP, call `impreza_deploy_catalog_app` using the chosen `app_name`,
`app_version`, the second server's `agent_id`, and boolean `standby: true`.
Omit `domain`, `vars.domain`, `onion` and `onion_import`. The hosted connector and
local package send the same option to `POST /platform/deployments`. The API
returns 404 for standby requests when its switch is off and 422 `UNSUPPORTED` for unreviewed catalog builds; a refused standby does not fall
back to an ordinary public deployment. A normal deployment without this option
still creates a managed hostname when no domain is supplied.

**Custom apps:** create the standby with a custom deployment and boolean
`standby: true` on the second server (MCP: `impreza_deploy_custom`; REST:
`POST /platform/deployments/custom`). The standby must use the **same, pinned
source** as the primary: an image by digest (`name@sha256:…`), a git build at the
exact 40-character commit, or an uploaded Compose file or build context, compared
by its frozen content. Every persistent volume of every service must be
declared, either as a `./<folder>` data bind or as a named volume of the project;
anything else is refused with 422 `STANDBY_DATA_UNCOVERED`, because the cold copy
would leave it behind. The standby gets no public hostname or onion and needs an
agent with the startup health capability. Variables and secrets are not part of
the data copy: move them with the
[configuration export, review and apply](/customer-workflows.html#configuration)
workflow. Then pair and verify the copy as described below. **A custom pair cuts
over only after a verified drill of that same pair**; without one, the cutover
review is refused with 409 `DRILL_REQUIRED`. Do not remove database records, use
development flags or create public copies to work around these checks.

## Protect this app assistant

**Available since 12 October 2026** in My Apps and the hosted MCP connector, and
since 13 October 2026 in the local `impreza-mcp` package 0.50.0 or later
(the `impreza_protect_app` prompt).

In **My Apps**, the **Protect this app** button starts from a running
Memos 0.31.0 or Uptime Kuma 2.5.5 catalog primary with an unchanged reviewed
recipe and an owned hostname. Select an online compatible server on your
account in another reported country. Confirm standby creation, wait for the
route-less copy to run, then separately confirm pairing and the first restore
drill. Each step has its own confirmation; the assistant never switches traffic
or purchases a server. A customer hostname still needs its separately confirmed
TXT verification, and its ownership TXT must remain published.

For MCP, request the `impreza_protect_app` prompt with the primary's
`deployment_id` and optional target `agent_id`. Retrieving it is read-only and
grants no authority. The playbook first checks visible tools, the current
credential scopes and the servers' `failover_location` metadata, then chains
existing catalog creation, pairing, drill and receipt tools. A declared external
country remains explicitly unverified. Missing or stale country information
cannot be replaced with a guess or a declaration to bypass a refusal.

No server in another country means you must supply an eligible server separately.
An unreviewed recipe or a database stack requires its own supported workflow.
An accepted or failed drill is not verified protection. After an uncertain write,
resume the saved receipt before requesting another copy or drill; the portal
retains one standby-creation receipt per primary and reuses it on a repeat
submission. If that saved standby is unavailable, inspect it rather than create
another automatically. A failed drill requires a new human decision to retry.

Only a **verified** drill supplies the dated measured copy age
(`data_age_seconds`) and restore-drill duration (`total_seconds`). These
observations do not promise zero data loss or a full traffic-cutover RTO; DNS
TTL, human decision time and traffic promotion were not measured.

An incremental checkpoint pilot is being tested with a **900-second pilot objective**
from the applied source point. This objective is not a recovery promise.
The source-to-apply latency of both serial rounds, dispatcher delay, queueing,
post-apply wait and clock uncertainty must fit that objective. A 300-second
objective requires a later measured round with a shorter dispatcher period.
Unknown or future clocks, unresolved writes and unavailable checkpoint evidence
cannot establish freshness. Reconciliation does not make an old source point new.
The existing verified cold-drill observations above remain the available evidence;
separate testing on two eligible test servers is still required for the pilot.
In the pilot, the standby application is stopped at the first checkpoint and
stays stopped until the standby is promoted: checkpoints are not followed by a
start or a healthy-start check of the standby application, because a running
application writes to its own data and the next checkpoint could no longer be
applied. Promotion starts it. Do not start the standby application by hand while
checkpoints run; if it is started, the next checkpoint ends uncertain and a new
full copy is taken.

## Pair and verify a cold copy

In **My Apps**, open the primary application's failover panel. Choose the healthy standby created in the previous section and review both reported countries. Pair them in cold mode. Back up the current primary, restore that exact completed backup to the standby and wait for the healthy redeploy caused by that restore. Confirm the copy using those three exact receipts: backup, restore and deploy command.

The equivalent REST operations are:

| Operation | Method and path, after `/v1` | Scope |
| --- | --- | --- |
| Declare an external agent's country | `POST /platform/agents/{id}/failover-jurisdiction` | deploy |
| Pair existing applications | `POST /platform/deployments/custom/{id}/failover-standby` | deploy |
| Read the pair | `GET /platform/deployments/custom/{id}/failover-standby` | read |
| Confirm the exact restored copy | `POST /platform/deployments/custom/{id}/failover-standby/confirm-sync` | manage |
| Prepare a cutover review | `POST /platform/deployments/custom/{id}/prepare-failover` | deploy |

For pairing, send `target_deployment_id` and `mode: "cold"`. For sync confirmation, send `backup_id`, `restore_id` and `deploy_command_id`. A ready label is revalidated before a cutover. Unrelated, stale or cross-account receipts are refused; confirmation does not create a copy for you. Preparation currently refuses a cold copy more than 3,600 seconds old.

## Review and apply the cutover

Preparation creates a review that expires after 15 minutes. Check the source and target identities, countries, hostname, backup age, planned interruption and the returned `review_digest`. The review itself does not stop an app or move traffic.

After the person responsible confirms that exact review, submit the returned cutover ID, unchanged digest and the boolean `confirm: true`. Do not derive the digest locally or reuse one after the reviewed state changes. For REST, an example using environment variables is:

```sh
jq -n --arg digest "$REVIEW_DIGEST" \
  '{review_digest: $digest, confirm: true}' > "$REQUEST_FILE"
curl --fail-with-body --request POST \
  --header "Authorization: Bearer $IMPREZA_API_TOKEN" \
  --header 'Content-Type: application/json' \
  --data-binary "@$REQUEST_FILE" \
  "$IMPREZA_API_BASE/v1/platform/failover-cutovers/$CUTOVER_ID/apply"
```

Choose a private temporary request file, and remove it after the call. Keep credentials out of command history, recordings and shared logs. `IMPREZA_API_BASE` is your verified REST origin; use the supported [Tor endpoint](onion-services.html#official-addresses) for a Tor-only workflow.

An accepted response only queues work. Keep the `cutover_id` and read `GET /platform/failover-cutovers/{id}` until the receipt is **verified** or reports an actionable failure. Verification includes the source fence, hostname ownership, target activation and the route probes. The pinned HTTPS check accepts at most one redirect to a relative path or the same reviewed HTTPS hostname on port 443, at the same reviewed IP, only when the next response is 2xx. Other hosts, HTTP, alternate ports, missing or invalid locations and further redirects are refused. The managed DNS record changes and the target obtains its HTTPS certificate. Resolver caches can delay a visitor's observation of the change.

During a network partition, the isolated source may continue serving. The candidate waits for its verified fence; it does not promote a second writer because a health check failed. When the source reconnects, its saved fence prevents it from reclaiming the route or serving again. A lost source is an operator recovery case, not a customer flag that bypasses this requirement.

If target activation fails after fencing, inspect the saved receipt first. `POST /platform/failover-cutovers/{id}/retry-activation` requires the original digest and a new explicit confirmation. It retries bounded target activation and revalidates ownership and DNS; it does not undo the fence or start a new cutover. Repeating the same accepted apply request returns the saved receipt.

## Drills and recovery measurements

The panel shows the last verified sync time, declared recovery objectives and the last drill's measured durations. A drill backs up the primary, replaces the standby's data with that copy, waits for its healthy redeploy and verifies it. The primary is read and traffic stays on it.

Run a drill with `POST /platform/deployments/custom/{id}/failover-standby/drills`, then read `GET /platform/failover-drills/{id}` until verified or failed. Set the policy with `POST /platform/deployments/custom/{id}/failover-standby/drill-policy`, using `interval_minutes` from 60 to 10,080, or `null` to stop scheduled drills. The first scheduled drill starts one interval later.

Declared RPO/RTO are objectives. Measured backup age describes the tested copy; the measured drill time covers that drill's work. It excludes human review and is **not the duration of a DNS cutover or a recovery guarantee**. Only a separately timed verified cutover measures that transition. Writes after the copied backup remain at risk.

## Standby alerts

A pair whose first sync was verified gets two alert rules on its **primary application**, enabled by default: `standby_stale` (the scheduled sync is past due — at least 30 minutes past its deadline with no drill running) and `drill_failed` (the pair's latest finished drill ended failed). They behave like every other app alert: they open once per condition, close with the reason when it clears, and deliver to your configured webhooks as `deployment.alert` and to the alerts list of My Apps. The evidence carries only the pair's state, ages and a closed failure code — never a location, address or application data.

Deleting one of these rules brings it back on the pair's next verified sync; disable it to turn it off for good. A pair without a drill policy has no sync deadline and cannot be "past due"; the stale rule stays quiet until a policy exists. While a drill runs, or the standby is being cut over, neither rule opens, and with failover disabled the open ones resolve and nothing new opens.

The failover panel and the existing REST/MCP standby read include `open_alerts` for that account and primary application only: up to four open `standby_stale` or `drill_failed` notices, each with `metric`, UTC `opened_at` and a bounded evidence projection. Evidence contains only state, nonnegative ages/intervals and known failure/trigger codes; unknown codes become `other`, invalid JSON becomes null, and extra stored fields are omitted. The notice disappears when its condition resolves. This read does not grant promotion authority.

Operator-controlled test notices, when explicitly enabled for an isolated test pair, carry `test_signal: true` in alert evidence and display **TEST SIGNAL** in the failover panel. A test notice verifies the alert path; it does not certify a restored copy or recovery readiness. The private test control is off by default and is not a customer workflow.

The minute tick deletes at most 500 resolved standby alerts older than 30 days per pass. Open alerts, recent history and other metrics are preserved. A storage error skips the sweep without stopping alert evaluation; deletion may therefore lag the retention threshold. This is a retention minimum, not a backup or an exact deletion deadline.

## Return to the previous server

Prepare with `POST /platform/failover-cutovers/{id}/prepare-failback`, read the returned review at `GET /platform/failover-failbacks/{id}`, and explicitly confirm its digest with `POST /platform/failover-failbacks/{id}/apply`.

The old host releases exactly the verified cutover's fence while its application stays stopped and unrouted. The pair is inverted: the old primary becomes an unprovisioned cold standby. An **inverted** receipt completes this step; **releasing** does not. No traffic moves during inversion. To return traffic, back up the current primary, restore it to that standby, confirm the new sync and review an ordinary return cutover. Do not serve the previous copy without this sequence.

## Retire an old managed VPS after promotion

Retirement is separate from failback and from cancelling a server. Keep the verified promoted primary serving. End the **exact old managed VPS** through the normal server-service procedure and verify that its service is **Terminated**. An Active, Suspended or Cancelled service is insufficient. The portal retirement action does not cancel billing or issue a remote termination command.

In the verified cutover panel, choose retirement, enter the exact old service ID and explicitly confirm the review. The REST equivalent is `POST /platform/failover-cutovers/{id}/retire-pair` with `review_digest`, integer `old_service_id` and boolean `confirm: true`. This action has no failover MCP tool in the public tool list.

Retirement rechecks ownership, the current primary's lease and service, the absence of old routes and the lack of pending old-host operations. It removes the pair, revokes the old agent and keeps an owned tombstone for the old application. Existing backup IDs remain linked to that owner and receipt, under the existing retention rules; this action does not delete backup objects or choose a new retention policy. The old backup schedule is disabled. The primary, its hostname lease and its service stay unchanged. A replay of the same accepted retirement returns its receipt.

`OLD_SERVICE_ACTIVE` means the old service has not reached the required Terminated state. Resolve it through the service procedure before retrying. Pending jobs, a changed lease or a prepared/releasing failback require review rather than bypass. External and dedicated hosts need an operator procedure; this managed-VPS action does not pretend to end them.

## Limits and release requirements

- No automatic health-based promotion, warm replication, private onion migration or migration of unsupported bindings is included.
- The tested ordinary cutover uses managed DNS. A customer's own domain must be verified through its supported procedure, and Impreza must not write that customer's DNS. This release does not establish a general own-domain cutover workflow.
- Do not assume a ten-minute undo timer exists. Any grace-window behavior must be verified separately before it is offered; the return procedure above remains a reviewed copy and cutover.
- Offered country pairs, dedicated-location mapping and commercial/retention terms follow the published offer and operator decisions. Two servers remain separate owned services. Pairing, promotion and retirement do not silently cancel either service or choose a new price.

## Related reference

- [My Apps and server access](tutorials/agent-apps-panels.html)
- [Configuration, backups and recovery](customer-workflows.html)
- [Database connections](service-bindings.html)
- [Onion services and official Tor addresses](onion-services.html)
- [REST API reference](api.html)
- [Connect an AI assistant](tutorials/ai-mcp-integration.html#tools)


## Verified customer hostname — not yet available

This next increment is separate from the first jurisdiction failover release. It
requires a separate release switch and an Impreza operated local DNS resolver.
It is not yet available. The first release supports the managed hostname and
public onion workflows only.

A running application with a direct customer hostname can request an ownership
challenge in My Apps, REST or MCP. Publish the returned TXT at
`_impreza-failover.<YOUR_HOSTNAME>` yourself. The challenge is account and hostname
bound, expires after 15 minutes, and can be consumed only once. A new challenge
replaces an earlier pending challenge. Successful verification lasts 24 hours;
keep the exact TXT published. The platform queries it again before pairing,
review and cutover. A missing or changed TXT, expired verification or a replaced
proof stops the cutover: verify again and prepare a new review. A verified name
remains reserved to its account after expiry; expiry never hands it to another
account automatically.

Ownership attempts share an account limit of 30 every 15 minutes across all
three entry points. Creating or verifying a challenge requires `manage`; reading
requires `read`. The hosted MCP requires an account credential without resource
confinement. My Apps also enforces session CSRF and account permissions.

- `POST /platform/deployments/{id}/failover-domain/challenge` with an empty body.
- `POST /platform/deployments/{id}/failover-domain/verify` with `challenge_id`.
- `GET /platform/deployments/{id}/failover-domain` for the saved state.
- MCP: `impreza_challenge_failover_domain`, `impreza_verify_failover_domain`, and
  `impreza_get_failover_domain` with `deployment_id` (and `challenge_id` to verify).

Impreza never writes your DNS. The reviewed cutover shows the exact A record and
target IPv4 value, and requires removal of AAAA and CNAME records for that name.
After an authenticated source fence, the single hostname lease advances to the
target epoch and the target publishes its route. You then change the reviewed A
record. Until the change propagates, visitors may still reach the fenced source;
the hostname does not respond on the target yet. Target ACME issuance uses the
HTTP/TLS challenge and starts working only after DNS reaches the target.

The saved receipt shows **Waiting for DNS change**, **DNS points to target**, then
**TLS issued**. A DNS observation records a time and describes that observation;
other resolvers can still hold the previous address until its TTL expires. The
platform accepts only the exact target IPv4 RRset with no alternate IPv6 address.
It then verifies the target certificate and HTTPS response directly at the
reviewed IP. Health never triggers promotion: only your explicitly confirmed
review, source fence and epoch transfer authorize it. A slow manual DNS change
keeps the accepted cutover pending. It does not revive the source or elect another
owner. An accepted fenced cutover continues reconciling if the creation switch is
later disabled.

Failback uses a separate reviewed fence release, reverse backup/restore and a
new reviewed cutover. Verify ownership again if needed. The return cutover has
the same manual DNS change and target TLS requirements.

DNS verification uses Impreza operated Unbound over TCP on loopback, with no
third-party recursive forwarder, query log, dnstap or telemetry. It queries the
public DNS authority with query name minimization; authoritative operators still
see the names necessary to answer. It validates DNSSEC where the zone is signed
and rejects bogus answers. Direct TXT/A records are required; aliases, wildcard
input, URLs, ports, IP literals, private names and onion names are unsupported in
this customer hostname workflow. Unbound response caching and stale answer
serving are disabled for this dedicated ownership resolver. The operator must
configure the resolver before enabling this increment. Resolver or storage
failure refuses verification and cutover rather than authorizing cached state.

The Protect this app assistant presents a separate unchecked authorization checkbox beside each exact creation, pairing and drill step, together with the typed CONFIRM field. Advancing or resuming resets both confirmations. No native browser dialog is required by this assistant. The backend retains the same confirmation, ownership and policy gates.

## Additional reviewed catalog apps — candidate, not released

The PrivateBin 2.0.6 candidate adds a separate reviewed failover
recipe. Its eligibility is off by default and requires an explicit operator
activation after validation. Ordinary PrivateBin installation is unchanged.
The portal and backend use the same closed review record; an enabled catalog
entry alone does not authorize a standby. Missing, malformed or duplicate
activation values, unreadable settings and changed recipe snapshots refuse
new enrollment or pairing. This candidate does not announce a public release
or completion of the real cross-country failover matrix.
