Move data between enviroments

Good afternoon.

Dashboard v3.1.2
Gateway v3.1.2

We have several unrelated evironments in our organisation with tyk.
The challenge is to migrate all APIs and policies to the new one.
Initially we exported all APIs and policies via tyk-sync dump

The problem is that if we use a JWT with a specified default policy, then when we import via tyk-sync from the jwt_default_policies ApiDefinition field, the value with the policy ID is removed.
In this case, through the REST API we see that the policy has a generated new “_id” and the original one is in the “id” field.
This is correct, as described in Move Policies Between Environments

Is this correct behaviour and do we need to re-bind the default policies via Dashboard?

Hi @ignashkins,

Is this correct behaviour and do we need to re-bind the default policies via Dashboard?

No, this is not the correct behavior based on sync. You also do not need to re-bind the default policies. As long as the properties below in the source and target environments are set properly, the policy ID should be copied over correctly.

  • Dashboard must have allow_explicit_policy_id: true and enable_duplicate_slugs: true
  • Gateway must have policies.allow_explicit_policy_id: true

You may also need to check that the dashboard has force_api_defaults: false. Please note that the sync operation needs to be done before copying the Keys to the source.

Hope this helps