Skip to main content

Prevent Environment Drift

Keep Staging and Production from silently diverging — then promote only the diffs you intend.

Environments are isolated on purpose. Drift happens when flags, targeting, or rollouts change in one environment and never get reviewed in another. Use Compare Environments to see the gap and copy selected configuration.

Why Staging and Production diverge​

Typical sources:

  • A flag enabled in Staging for QA and left off (or on a different percentage) in Production
  • Targeting rules or segments edited in one environment only
  • Hotfixes applied directly in Production
  • New flags created and configured in Development, then never promoted

Isolation is correct. Unreviewed differences are the problem.

Compare Environments​

The Compare action on Environments opens Compare Environments:

  1. Navigate to Environments
  2. Click Compare
  3. Choose a Left environment (source) and a Right environment (target)
  4. Click Compare

The Differences table lists flags that do not match: missing keys, enabled vs disabled, and filter/targeting changes. Apply copies configuration from left to right.

Review diffs and sync selectively​

Do not copy every difference.

  1. Read each row (feature key, left state, right state, difference type)
  2. Select only the flags you mean to promote
  3. Optionally add notes for audit
  4. Click Apply Selected Changes (or Request Selected Changes when your workspace requires approval)
  5. Confirm the copy from left to right
Production Safety

Always test feature flags in Development and Staging before promoting to Production. Use gradual rollouts even after promotion. Applying a Staging configuration onto Production can enable a flag for real users immediately.

Users without Manage Applications permission can view diffs but cannot apply them.

A practical cadence​

  • Compare Staging vs Production before a release
  • Promote only the flags in that release
  • After a Production hotfix, compare again and copy back to Staging so the next promotion is not a surprise
  • Align environment names with your deploy stages — see Syncing & Comparing Environments

Best Practices​

  1. Compare before promote: Treat the diff list as the change set
  2. Select, don't blanket-sync: Copy the flags you reviewed
  3. Protect Production: Confirm the direction (left → right) before applying
  4. Keep Staging honest: Mirror Production hotfixes back so Staging stays a rehearsal

Next Steps​