Skip to content

Compare and Copy Environments

Staging works, production is behind, and you need to know by how much. The Compare page lists every flag whose configuration differs between two environments. From there you can copy one flag’s targeting across, after a preview shows exactly what will change.

Compare is on every plan. Copying is on Team, Pro, Business and Enterprise.

Open Compare in the project navigation, then choose a Base environment and a Compare with environment. The table lists each flag and the sections that differ:

  • On/off: whether the flag is enabled in each environment
  • Default variation: what the flag serves when no rule matches
  • Strategy: a single variation or a percentage rollout
  • Rules: the targeting rules, including their order
  • Prerequisites: the flags this one depends on

Differences only is on by default, so the table starts with the flags that need attention. Switch it off to see every flag. You can also filter by tag, and by owner on Pro and above with flag owners.

The same rules in a different order count as a difference, because order changes which rule matches first. A flag that has no configuration in one of the environments shows as different and is labeled “not configured” on that side.

Click a row to open a side-by-side view of both environments. It shows the full rule lists next to each other and marks each rule that has no identical match on the other side. The view also has a button for each direction, such as Copy staging → production.

Copying takes one flag’s targeting from a source environment and applies it to a target environment. You can start it from the side-by-side view, or from Copy from… on the flag’s Environments tab.

The dialog asks for:

  1. Copy from: the source environment.
  2. Also copy on/off state: unchecked by default.

As soon as you pick a source, the dialog shows a preview of what will change in the target, plus any warnings. Nothing is saved until you press Apply.

PartCopied
Default variationYes
StrategyYes
Targeting rulesYes. They replace the target’s rules, in the source’s order
PrerequisitesYes. They replace the target’s prerequisites
On/off stateOnly when you check Also copy on/off state

Variations belong to the flag, and segments belong to the project, so every reference in the copied rules is valid in the target. A copied percentage rollout puts the same users in the same buckets as in the source, because the bucketing salt belongs to the flag.

Target rules that are identical to an incoming rule keep their identity, so unchanged rules are left alone. If nothing would change, the dialog says the environment already matches and Apply has nothing to do.

Turning a flag on in the target is a bigger step than aligning its targeting, so the checkbox is off unless you ask for it. If the source is on, the target is off and you left the box unchecked, the preview warns that on/off was not copied.

Warnings don’t block the copy. You may see that:

  • the target is a critical environment
  • the target has a scheduled change for this flag that is still pending and will apply on top of the copy later
  • a copied prerequisite is not currently met in the target
  • on/off was not copied, as described above

Copied prerequisites are checked against the target environment before anything is saved: each prerequisite flag must exist and not be archived, its expected variation must exist, and the set must not create a cycle there. If any fail, the whole copy is refused and the preview lists each one with the reason. Nothing is silently dropped. Fix the source environment first, then copy again.

A prerequisite that is valid but not yet met in the target is allowed, with a warning. The flag then serves its off variation in the target until the prerequisite is satisfied, which lets you stage a flag ahead of the flag it depends on.

The preview carries a fingerprint of both the source and the target. If either one changes before you press Apply, the copy is refused and the preview runs again so you can review the new result. Apply is only ever the change you were shown.

If the target environment requires a change reason, Apply asks for one before it saves, and the reason goes into the audit log. Cancel the prompt and nothing is copied. A copy that changes nothing writes nothing, so it leaves no audit entry.

The audit log records the individual changes to the target, and one summary entry that names the source environment. Both show on the flag’s History tab.

The same operations are on the public API. Send the reason for a critical target in the X-Intent-Reason header, as for any other write.

OperationEndpoint
Compare all flags in a projectGET /api/v1/orgs/{org}/projects/{project}/compare
Compare one flagGET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/compare
Copy a flag’s configurationPOST /api/v1/orgs/{org}/projects/{project}/flags/{flag}/environments/{env}/copy

The project compare takes base and other (an environment key or ID), plus differentOnly, tag, owner, limit and cursor, and pages with a cursor like the flags list.

The copy endpoint writes into the environment in the path. Its body names the source and sets includeState and dryRun. To apply a previewed copy, send back the expectedSourceETag and expectedTargetETag from the preview. If either has changed, the call fails with 412 and you preview again.

Terminal window
# Preview. Nothing is saved.
curl -X POST "https://api.featureflip.io/api/v1/orgs/acme/projects/checkout/flags/new-checkout/environments/production/copy" \
-H "Authorization: Bearer $FEATUREFLIP_TOKEN" \
-H "Content-Type: application/json" \
-d '{"source": "staging", "includeState": false, "dryRun": true}'

The response lists the changes to the target, the two ETags, and any warnings. Request and response shapes for all three operations are in the Management API Reference.

Two tools in the MCP server cover the same ground:

  • compare_environments is read-only. It returns the flags that differ between two environments, and every flag when you set different_only to false.
  • copy_flag_config previews by default and changes nothing. It copies on/off only with include_state. To apply, pass dry_run: false along with both ETags from the preview.
CapabilityPlans
Compare environmentsEvery plan
Copy a flag’s configurationTeam, Pro, Business and Enterprise

Copy is plan-gated in the dashboard, the API and MCP, and so is its preview. On a plan without it, the dialog explains that copying is available on Team and above.