# Using Migration script (old way)

## Migration script

We prepared a migration CLI script called `dr-migrate` which is completely free to download and use for anyone. Find the script in its respective [GitHub repository](https://github.com/decisionrules/dr-migrate). In order to install it locally, follow the steps described in the README file.

The tool can be used to migrate rules in one command, or export the rules from a given environment and import them to another one. Use the latter approach if you cannot access both your environments from one location. The rules are always exported to a JSON file. You can choose from a list of several migration strategies, which determine the way of handling conflicts upon import.

{% hint style="info" %}
Use the migration script with great caution. Be sure to know the effects of the used strategy before you use it in production. You may easily delete or rewrite the rules in the target environment.
{% endhint %}

Under the hood, the migration script uses the [Management API](/doc/v1/api/management-api.md) to send requests to the source and target environment. All you need to do is set your environment URLs and Management API keys in an automatically generated `config.json` file, as described in the README. Then you can start to easily and freely migrate your rules between environments.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.decisionrules.io/doc/v1/on-premise-docker/cd-ci-pipelines/using-migration-script-old-way.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
