Cloning existing flags
Read time: 2 minutes
Last edited: Nov 05, 2024
Overview
You can create new flags by cloning existing flags. When you clone a flag, LaunchDarkly makes a new flag and copies the original flag's targeting configuration for all environments, including default values and whether the flag is toggled on or off. You can then modify the clone's configuration if needed.
To clone a flag:
- Navigate to the Flags list and open the flag you wish to clone.
- Click the gear icon. The flag's "Settings" page appears.
- In the "Clone flag" section, click Clone this flag.
- The "Clone feature flag" dialog appears:
- Enter a unique, human-readable Name.
- (Optional) Update the unique flag Key. You'll use this key to reference the flag in your code. A suggested key auto-populates from the name you enter, but you can customize it if you wish.
- (Optional) Enter a Description of the new flag. A brief, human-readable description helps your account members understand what the flag is for.
- (Optional) Click into the Tags menu and choose one or more tags for your flag.
Tags are useful for managing flag permissions using custom roles. For example, you can tag a flag as "Marketing" and "DevOps," and then use these tags to determine who has read or write access for the flag. To learn more, read Custom roles.
- Click Save flag. You are taken to the new flag's targeting page.
The new flag appears in the Flags list.
If the flag you are cloning has an active guarded rollout or progressive rollout, the rollout is not cloned.
You can also use the REST API: Copy feature flag