Feature Flags: Cloning a Tenant using the deploy-cli Tool
There may be situations in which it is desirable to 'clone' a tenant. For example, a business organization may decide on a rebranding strategy. In those circumstances, it may be a requirement that tenant names should be better aligned with the new brand name. However, it is not possible to simply rename a tenant. As a consequence, the recommended approach in these circumstances would be to create a new tenant and then 'clone' the tenant configuration and environment settings from an existing tenant.
It is important to know that each tenant has a set of feature flags that influence its operational behavior. This raises the concern that when a tenant's settings are 'cloned,' these vital feature flags might not be copied to the new tenant. If that were to happen, there could be differences between the 'old' and 'new' tenant environments, with the result that applications might not run as expected in the new tenant.
This article explains how to 'clone' an existing tenant to ensure that the set of feature flags from the 'old' tenant is carried over to the 'new' tenant.
- Deploy-cli
- Cloning Tenants
Use of deploy-cli
The Auth0 Deploy-CLI is a tool for managing an Auth0 tenant configuration. It can be integrated into a development workflow as a standalone CLI or as a node module.
One possible use is to 'clone' the configuration settings (including the feature flags ) of an existing tenant and restore them to a new tenant.
When configuring the Deploy-CLI tool, ensure that the 'tenant settings' supported resource type is selected. This will ensure that the necessary feature flags are carried across from the current tenant to the new tenant.
How this works
Tenant flags express a complex mix of external and internal-only functionality. Depending on when and in which environment a tenant was created, two tenants may not have the same set of feature flags.
There are two types of tenant flags:
- Internal flags are used for tasks like facilitating migrations or toggling deprecated functionalities, none of which are suitable for customers to configure.
- Customer-configurable flags: these are enabled by the customer when configuring their tenant environment
The Deploy-CLI tool will only operate on flags that are configurable by users and will ignore all others. This maintains interoperability between different tenants across different environments.
So technically, not all flags may be copied over. However, this behavior is intentional, as not all existing flags may be required in the new tenant environment.
In the majority of cases, there should be no difference in terms of how applications perform in the current tenant and the new tenant. However, there may be occasional instances in which legacy flags might need to be manually enabled by Auth0 personnel following the migration. In such cases, there might be some short-term differences in application behavior between old and new tenants. If such problems arise, please create a support case in the Support Center describing the application's expected behavior and current behavior following migration.
Related resources