Before You Begin
To run this migration kit, you need:- The Confidence plugin installed in your AI assistant
- An Optimizely personal access token or service account token with read access to flags, rules, and audiences, stored in the
OPTIMIZELY_API_TOKENenvironment variable. You can create one under Account Settings > API Access in the Optimizely app. - The Confidence Flags MCP server, authenticated with your account
- The Confidence Documentation MCP server, used during code transformation
- Optional: a Confidence REST API token stored in the
CONFIDENCE_TOKENenvironment variable, required for partial traffic allocation, reusable audiences as segments, and exclusion groups
Run the Migration
Invoke the kit with the/confidence:migrate-optimizely command in your AI assistant.
Plan the flag migration
Run
/confidence:migrate-optimizely plan flag. The kit scans your Optimizely flags, rulesets, and audiences and writes a migration plan file.Review the plan
The plan lists every flag with its rules and traffic allocation, and marks anything that can’t migrate automatically. Plan files are resumable, so you can pause and continue later.
Execute the flag migration
Run
/confidence:migrate-optimizely execute <plan-file>. The kit recreates your flags in Confidence with their variations, audiences, and rules in priority order.Plan and execute the code migration
Run
/confidence:migrate-optimizely plan code, review the plan, then execute it. If your app already uses OpenFeature, the kit swaps the registered provider and leaves call sites unchanged. Otherwise it rewrites each Optimizely SDK call to the Confidence SDK, creating one pull request per flag.What Gets Migrated
| Optimizely | Confidence |
|---|---|
| Flag | Flag |
| Variation with variable values | Variant with a payload |
| Targeted delivery or A/B rule | Targeting rule, one per Optimizely rule in priority order |
| Audience | Segment with the REST API token, or criteria copied into rules |
| Traffic allocation and variation split | Variant allocations inside the rule |
| Default variation | Final catch-all targeting rule |
| Bucketing ID | Entity field of your choice, such as user_id |
Known Limitations
The kit flags these Optimizely features for manual review because Confidence doesn’t support them:- Substring and general regular expression matching
- Presence conditions that check whether an attribute exists
- Audience conditions based on browser, device, query parameter, cookie, or location
- Multi-armed bandits, because Confidence allocations are static
- Partial rollouts with fall-through and exclusion groups, unless you use the REST API token
Analyze Historical Experiments
The migration kit moves your flags and code, not your historical experiment results. To re-analyze experiments that ran on Optimizely, export your decision events to your data warehouse and follow the assignment table from Optimizely decision events guide. The analysis workflow page explains the process in more depth.Related Resources
Migrations Overview
How migration kits work and how to install the plugin
Use AI with Confidence
Set up the Confidence MCP servers for your AI assistant
Analyze a Past Experiment
Re-analyze experiments that ran on another platform
SDK Integration
Integrate Confidence SDKs into your application

