> ## Documentation Index
> Fetch the complete documentation index at: https://confidence.spotify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from Optimizely to Confidence

> Learn how to migrate flags, rules, and audiences from Optimizely Feature Experimentation to Confidence with the AI-powered migration kit.

export const HowToSchema = ({name, description, steps = []}) => {
  const schema = {
    "@context": "https://schema.org",
    "@type": "HowTo",
    name,
    description
  };
  if (steps.length > 0) {
    schema.step = steps.map((s, i) => ({
      "@type": "HowToStep",
      position: i + 1,
      name: typeof s === "string" ? s : s.name,
      text: typeof s === "string" ? s : s.text || s.name
    }));
  }
  return <script type="application/ld+json" dangerouslySetInnerHTML={{
    __html: JSON.stringify(schema)
  }} />;
};

<HowToSchema
  name="Migrate from Optimizely to Confidence"
  description="Migrate flags, rules, and audiences from Optimizely Feature Experimentation to Confidence with the AI-powered migration kit."
  steps={[
{
  name: "Plan the flag migration",
  text: "Run /confidence:migrate-optimizely plan flag. The kit scans your Optimizely flags, rules, and audiences and writes a migration plan file.",
},
{
  name: "Review the plan",
  text: "The plan lists every flag with its rules and traffic allocation, and marks anything that can't migrate automatically.",
},
{
  name: "Execute the flag migration",
  text: "Run /confidence:migrate-optimizely execute with the plan file. The kit recreates your flags in Confidence with their variations, audiences, and rules in priority order.",
},
{
  name: "Plan and execute the code migration",
  text: "Run /confidence:migrate-optimizely plan code, review the plan, then execute it. The kit rewrites each Optimizely SDK call to the Confidence SDK, creating one pull request per flag.",
},
]}
/>

Run this skill to migrate from Optimizely to Confidence:

```bash theme={null}
npx skills add spotify/confidence-ai-plugins --skill migrate-optimizely
```

The installer works with Claude Code, Cursor, Codex, Gemini CLI, and other AI assistants, and asks which one to install to. You can also install the full [Confidence plugin](/docs/migrations/overview#install-the-confidence-plugin) with your assistant's own plugin manager.

The kit moves your flags, rules, and audiences from Optimizely Feature Experimentation to Confidence, then rewrites your application code from the Optimizely SDK to the Confidence SDK. See the [migrations overview](/docs/migrations/overview) for how migration kits work.

## Before You Begin

To run this migration kit, you need:

* The [Confidence plugin](/docs/migrations/overview#install-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_TOKEN` environment 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_TOKEN` environment 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.

<Steps>
  <Step title="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.
  </Step>

  <Step title="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.
  </Step>

  <Step title="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.
  </Step>

  <Step title="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.
  </Step>
</Steps>

<Warning>
  The kit migrates stable flags only. It excludes live A/B tests because Confidence uses a different bucketing hash, so migrating a running test would reshuffle its users. Conclude running experiments before migrating, or restart them in Confidence.
</Warning>

## 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](/docs/quickstarts/analyze-past-experiment#assignment-table-from-optimizely-decision-events) guide. The [analysis workflow](/docs/experiments/workflows/analysis) page explains the process in more depth.

## Related Resources

<CardGroup cols={2}>
  <Card title="Migrations Overview" href="/docs/migrations/overview">
    How migration kits work and how to install the plugin
  </Card>

  <Card title="Use AI with Confidence" href="/docs/quickstarts/use-mcp">
    Set up the Confidence MCP servers for your AI assistant
  </Card>

  <Card title="Analyze a Past Experiment" href="/docs/quickstarts/analyze-past-experiment">
    Re-analyze experiments that ran on another platform
  </Card>

  <Card title="SDK Integration" href="/docs/sdks/introduction">
    Integrate Confidence SDKs into your application
  </Card>
</CardGroup>
