Migration routine ================= Surroundings ------------ If you use the product Docker deployment, skip this step (all the required dependencies are already installed in the Lambda service image). Otherwise, you need to: * replace all Lambda project files with the files from the current version * install python dependencies: .. warning:: It is strongly recommended to create a virtual surroundings for python dependencies installation. .. code-block:: bash pip install -r requirements.txt Service settings migration -------------------------- If you don't use the Configurator service, all you need is to set up your Lambda configuration file *luna_lambda/configs/config.conf*. Otherwise, you need to execute settings migration. If your previous product version used non-default service settings, backup the service settings dump-file. To create the dump-file, use the following options (may be executed from anywhere on your server): .. code-block:: bash 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: .. code-block:: bash [LUNA_CONFIGURATOR_DB] #: [string] database type - "postgres" DB_TYPE = postgres #: [string] database host DB_HOST = 127.0.0.1 #: [integer] database port; 5432 - default for "postgres" type DB_PORT = 5432 #: [string] database username DB_USER = luna #: [string] database password DB_PASSWORD = luna #: [string] database name for "postgres" type DB_NAME = luna_configurator and execute the command: .. code-block:: bash (cd luna_lambda/configs/configs && python -m configs.migrate head --config=) If you use the product Docker deployment, use the following options: .. code-block:: bash docker run \ -v /etc/localtime:/etc/localtime:ro \ -v :/srv/luna_lambda/configs/configs/migration/config.conf \ --rm \ --network=host \ --entrypoint=/bin/bash \ /luna-lambda: \ -c "cd /srv/luna_lambda/configs/configs; python3 -m configs.migrate head;" Make sure your non-default service settings are up to date with your backup settings dump file. Database migration ------------------ You need to execute migration scripts to update your Lambda database structure. .. warning:: It is highly recommended to create a backup of your database before applying any changes. If you don't use the Configurator service, you need to set up your Lambda configuration file and run the migration with the following options: .. code-block:: bash alembic -x config=luna_lambda/configs/config.conf upgrade head If you use the Configurator service, use the *luna-config* option with the Configurator service origin: .. code-block:: bash alembic -x luna-config=http://127.0.0.1:5070/1 upgrade head If you use the product Docker deployment, use the following options: .. code-block:: bash docker run \ -v /etc/localtime:/etc/localtime:ro \ --rm \ --network=host \ --entrypoint=/bin/bash \ /luna-lambda: \ -c "alembic -x luna-config=http://127.0.0.1:5070/1 upgrade head" Compatibility ------------- Before starting the Lambda service, make sure the other services are migrated to compatible versions (i.e. belong to the current release).