---
title: Migrate Flags with the Flag Migration CLI
description: >-
  Learn how to use the Datadog Flag Migration CLI to migrate feature flags from
  other providers to Datadog Feature Flags.
breadcrumbs: >-
  Docs > Feature Flags > Feature Flags Guides > Migrate Flags with the Flag
  Migration CLI
---

# Migrate Flags with the Flag Migration CLI

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

## Overview{% #overview %}

The [Datadog Flag Migration CLI](https://github.com/DataDog/dd-flag-migration) is a command-line tool that helps you migrate feature flags from other providers to [Datadog Feature Flags](https://docs.datadoghq.com/feature_flags.md). The CLI reads flag definitions from a source provider and recreates them in Datadog, preserving targeting rules, variations, and rollout configurations where possible.

## Prerequisites{% #prerequisites %}

Before running the CLI, make sure your Datadog organization is set up:

- **Users and Teams**: Your Datadog organization should be provisioned with the users and teams needed to manage flags. The CLI does not create users or teams for you.
- **Feature Flag Environments**: The [feature flag environments](https://docs.datadoghq.com/feature_flags/concepts/environments.md) you plan to migrate into should be created before running the CLI. The CLI does not create environments for you.

For details on how the migration works and the providers it supports, see the [GitHub repository](https://github.com/DataDog/dd-flag-migration).

## Run the CLI{% #run-the-cli %}

Run the migration with `npx`:

```bash
npx @datadog/dd-flag-migration migrate
```

For full configuration options, supported source providers, authentication setup, and troubleshooting, see the [`dd-flag-migration` README on GitHub](https://github.com/DataDog/dd-flag-migration).

## Further reading{% #further-reading %}

- [Feature Flags Overview](https://docs.datadoghq.com/feature_flags.md)
- [Migrate Your Feature Flags from LaunchDarkly](https://docs.datadoghq.com/feature_flags/guide/migrate_from_launchdarkly.md)
