This topic explains how to target contexts with migration flags.
The different stages of a migration flag are expressed by the flag’s variations. Migration flags have built-in variations that you cannot edit, because they are linked to the migration’s stages. To progress through stages in a migration, adjust the percentage rollout to serve a different variation to a larger group, until 100% of contexts receive the same variation. We recommend progressing through the stages in the order they’re presented.
Migration flag cohorts are analogous to the targeting rules for other types of feature flags. The default cohort is analogous to the default rule.
You can target cohorts in mostly the same ways you target rules, but cohorts always serve a percentage rollout. This helps visualize the progress of a migration. To learn more about rollouts, read Percentage rollouts.
You must specify a default cohort that this flag targets when the contexts specified in it are not a part of any other cohort. We recommend allocating 100% of this cohort in the “off” stage.
Here’s how to create a cohort:

You cannot target individual contexts with a migration flag. If you need to target an individual context, create a cohort that contains only that context.
The off variation for a migration flag is always off. This ensures that migrations always begin in the correct stage.
Migrations with six stages require you to specify a context kind to represent how the migrated data is partitioned. This context kind only targets contexts for the migration flag.
Migration flags with six stages have the following restrictions:
segmentMatch operator because segments can reference other context kindsTo learn more about when to use two, four, or six-stage migrations, read Performing multi-stage migrations with migration flags.
Some targeting actions may create issues that could impact your data integrity. If a scenario like this occurs, a warning appears when you try to save.
Examples of actions that may cause safety issues are:
off stageoff stage when a later cohort causes readsoff stage when a later cohort (from its old position) causes reads from the new systemYou can also use the REST API: Get migration safety issues