This script allows you to synchronize feature flags between two Unleash instances using the export and import APIs provided by Unleash. The script exports feature flags from the source instance and imports them into the target instance.
This script can also be integrated into a continuous deployment pipeline, allowing you to automatically synchronize feature flags between instances at a frequency determined by your pipeline configuration.
-`SOURCE_API_TOKEN`: The API token for the source Unleash instance. This can be a personal access token or a service account token with enough privileges to perform the export operation.
-`TARGET_API_TOKEN`: The API token for the target Unleash instance. This can be a personal access token or a service account token with enough privileges to perform the import operation.
If change requests are enabled in the target project, the import process will go through the change request process, allowing you to review the changes before applying them.
The script prints each step of the export and import process, providing feedback on the success or failure of each operation.
## Troubleshooting
Here are some common issues you might encounter and how to resolve them:
1. Make sure you use the correct URLs for the source and target instances.
2.Ensure that the API tokens have the necessary permissions to perform export and import operations.
3. Verify that the specified source and target environments exist.
4. Check that the target project exists.
5. If you have change requests enabled in the target project, ensure that there are no pending change requests for the same API token.
If you would like to give feedback on this feature, experience issues or have questions, please feel free to open an issue on [GitHub](https://github.com/Unleash/unleash/).