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.
Compare two environments
Section titled “Compare two environments”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.
Copy a flag’s configuration
Section titled “Copy a flag’s configuration”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:
- Copy from: the source environment.
- 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.
What gets copied
Section titled “What gets copied”| Part | Copied |
|---|---|
| Default variation | Yes |
| Strategy | Yes |
| Targeting rules | Yes. They replace the target’s rules, in the source’s order |
| Prerequisites | Yes. They replace the target’s prerequisites |
| On/off state | Only 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.
On/off state
Section titled “On/off state”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 in the preview
Section titled “Warnings in the preview”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
Prerequisites
Section titled “Prerequisites”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.
If something changed after the preview
Section titled “If something changed after the preview”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.
Critical environments
Section titled “Critical environments”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.
From the Management API
Section titled “From the Management API”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.
| Operation | Endpoint |
|---|---|
| Compare all flags in a project | GET /api/v1/orgs/{org}/projects/{project}/compare |
| Compare one flag | GET /api/v1/orgs/{org}/projects/{project}/flags/{flag}/compare |
| Copy a flag’s configuration | POST /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.
# 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.
From the MCP server
Section titled “From the MCP server”Two tools in the MCP server cover the same ground:
compare_environmentsis read-only. It returns the flags that differ between two environments, and every flag when you setdifferent_onlyto false.copy_flag_configpreviews by default and changes nothing. It copies on/off only withinclude_state. To apply, passdry_run: falsealong with both ETags from the preview.
| Capability | Plans |
|---|---|
| Compare environments | Every plan |
| Copy a flag’s configuration | Team, 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.