Migration routine

Surroundings

If you use Luna Platform Docker deployment, skip this step (all the required dependencies are already installed in the Api service image). Otherwise you need to:

  • replace all the Api project files with the files of the current version

  • install python dependencies:

Warning

It is strongly recommended to create virtual surroundings for python dependencies installation.

pip install -r requirements.txt

Service settings migration

If you don’t use Configurator service, all you need is to set up your Api configuration file luna_api/configs/config.conf. Otherwise, you need to execute settings migration.

If your previous Luna Platform version was used with non-default service settings, backup the service settings dump-file. To create a dump-file, use the following options (may be executed from anywhere on your server):

wget -O settings_dump_backup.json 127.0.0.1:5070/1/dump

To perform the migration, set up your migration configuration file in the following format:

[LUNA_CONFIGURATOR_DB]

#: [string] database type - "postgres" or "oracle"
DB_TYPE = postgres
#: [string] database host
DB_HOST = 127.0.0.1
#: [integer] database port; 5432 - default for "postgres" type, 1521 - default for "oracle" type
DB_PORT = 5432
#: [string] database username
DB_USER = luna
#: [string] database password
DB_PASSWORD = luna
#: [string] database name for "postgres" type, SID name for "oracle" type
DB_NAME = luna_configurator

and execute the command:

(cd luna_api/configs/configs && python -m configs.migrate head --config=<YOUR_CONFIG_PATH>)

If you use Luna Platform Docker deployment, use the following options:

docker run \
    -v /etc/localtime:/etc/localtime:ro \
    -v <YOUR_CONFIG_PATH>:/srv/luna_api/configs/configs/migration/config.conf \
    --rm \
    --network=host \
    --entrypoint=/bin/bash \
    dockerhub.visionlabs.ru/luna/luna-api:<Api_tag> \
    -c "cd /srv/luna_api/configs/configs; python3 -m configs.migrate head;"

Make sure your non-default service settings are up-to-date with your backup settings dump-file.

Compatibility

Before starting the Api service, make sure other services are migrated to compatible versions (i.e. belong to the current release).