Updating a podman installation

This section outlines the steps to update your SmartScope installation with Podman/Docker

  1. Back up your database

    This step is mostly to protect your data in case the update fails.

    ## REPLACE YYYYMMDD by the current date ##
    sudo podman exec smartscope-db /bin/bash -c 'mysqldump --user=$MYSQL_USER --password=$MYSQL_ROOT_PASSWORD $MYSQL_DATABASE > /var/lib/mysql/YYYYMMDD_dump.sql'
    
  2. Stop SmartScope

    sudo podman-compose down
    
  3. Pull the latest version

    To update your podman installation, first go to your smartscope directory, where you initially cloned the repository, Copy your docker-compose.yml file in case there is an update to that file and pull the update.

    cd /to/Smartscope/directory/
    cp docker-compose.yml docker-compose-bak.yml
    git pull
    

    If the docker-compose.yml was changed, make that your volume and enviroment sections are the correct. Use the back up file to copy the values back in.

  4. Restart the pod

    sudo podman-compose up -d
    

    Note

    If the Dockerfile changed, it will rebuild the new image

  5. Apply database migrations

    There is a chance that something changed in the database and, to avoid errors, try applying the migrations

    sudo podman exec smartscope manage.py migrate
    

    Note

    The output may throw warnings. This is ok as long that there isn’t errors.