Skip to content

Updating from version v0.1.1 to v0.2.0

Updating to v0.2.0

Osvauld version v0.2.0 includes schema changes from v0.1.1

Users are required to run a data migration scripts along with updating the backend docker image

Updating backend image

You can pull the image for v0.2.0 from dockerhub

Terminal window
docker pull osvauld/backend:v0.2.0

Update the backend with the new image. The schema changes to the database will be done automatically along with the docker image update

stop and delete the already running image:

Terminal window
docker stop osvauld_backend
docker rm osvauld_backend

start the latest image, it will run db migation

Terminal window
docker run --name osvauld_backend \
-d \
-p 80:8000 \
-p 443:8000 \
-e MASTER_DB_HOST=<db_host> \
-e MASTER_DB_NAME=<db_name> \
-e MASTER_DB_USER=<db_user> \
-e MASTER_DB_PASSWORD=<db_password> \
-e MASTER_DB_PORT=<db_port> \
-e MASTER_SSL_MODE=require \
-e AUTH_SECRET=<auth_secret> \
osvauld/backend:v0.2.0

Migrating Data

Migrating data to support the new backend image requires a python script execution

Download Script

download the script

Terminal window
wget https://raw.githubusercontent.com/osvauld/osvauld_be/develop/scripts/migrate_v011_to_v020.py

Install dependencies

The python script requires the dependency psycopg2. You can install it via pip

Terminal window
pip install psycopg2-binary

Edit connection parameters in the script

Edit the connection parameters in the script with you database parameters

The parameters are present at line number 5 in the script

# Connection parameters
dbname = "osvauld"
user = "postgres"
password = "password"
host = "host_url"

Run the Script

Terminal window
python migrate_v011_to_v020.py