# Introduction

Once you submit and test a certain workflow or module instance on one, you'd probably be looking to enable it on all the AWF environements soon. This is why we have developed a migration tool, called awf-migrate, which is a command line tool that takes the names of the objects you want to migrate and the respective environments, and handles the job itself.

# ๐Ÿ”จ Installation

  • Clone the repository locally git clone https://gitlab.arup.com/awf/awf-migrate
  • You first have to provide a configuration file with API Keys in config/config.json based on the template.
  • Install Poetry globally pip install poetry
  • Install dependencies poetry install

# Configuration file

The configuration file is meant to allow you to choose different kinds of authentication for each environment. You only need to suplement one of the fields. You can use a client_id or access_token to connect to AWF. As an alternative, you can use API keys if you are an admin of AWF. Please check out more about authentication here.

{
  "auth": {
    "environments": {
      "staging": {
        "api_key": null,
        "client_id": null,
        "access_token": null
      },
      "dev": {
        "api_key": null,
        "client_id": null,
        "access_token": null
      },
      "prod": {
        "api_key": null,
        "client_id": null,
        "access_token": null
      }
    }
  }
}

# ๐Ÿšฆ Usage

You can check the up-to-date requirements for each command you can use the help page.

You can check the help for commands using --help:

python main.py -h
python main.py module-instance -h
python main.py workflow -h

# ๐Ÿ”— Migration

You have to provide an origin and destination environments, the type of object you want to migrate (i.e workflow), and one or more (space separated) identifiers (i.e tutorial).

# Migrate individual objects

Objects (either Workflow or ModuleInstance) must be space-separated slugs (names).

python main.py workflow --origin stag --destination dev tutorial system-test

# Migrate all objects

To copy all the objects of a certain type over, you can use *.

python main.py workflow --origin stag --destination dev *