Upgrade

Danger

If you are upgrading to version 1.0, additional steps are required, see Upgrading to 1.0.x.

Warning

Before upgrading, make a backup of all data:

Warning

For now, releases do not follow semantic versioning. Any version may contain backward-incompatible changes.

Note

Depending on the operating system and the version of Python installed, additional dependencies may be required, such as gcc or libgdal-dev.

From PyPI

Warning

Only if FitTrackee was initially installed from PyPI
  • Stop the application and activate the virtualenv

  • Upgrade with pip

$ pip install -U fittrackee
  • Update environment variables if needed and source environment variables file

$ nano .env
$ source .env
  • Upgrade database if needed (see changelog for migrations):

$ ftcli db upgrade
  • Restart the application and task queue workers (if email sending is enabled).

From sources

Warning

Only if FitTrackee was initially installed from sources.

Prod environment

  • Stop the application

  • Change to the directory where FitTrackee directory is located

  • Download the last release (for now, it is the release v1.1.0) and overwrite existing files:

$ wget https://github.com/SamR1/FitTrackee/archive/v1.1.0.tar.gz
$ tar -xzf v1.1.0.tar.gz
$ cp -R FitTrackee-1.1.0/* FitTrackee/
$ cd FitTrackee
$ make install-python
  • Upgrade database if needed (see changelog for migrations):

$ make upgrade-db
  • Restart the server and Dramatiq workers:

$ make run

Note

If email sending is disabled: $ make run-server

Dev environment

  • Stop the application and pull the repository:

$ git pull
$ make install-dev
  • Upgrade database if needed (see changelog for migrations):

$ make upgrade-db
  • Restart the server:

$ make serve
  • Run Dramatiq workers:

$ make run-workers

Upgrading to 1.0.x

Note

This paragraph describes the upgrade from a version prior to 1.0.0 to version 1.0.x.

The version 1.0.0 introduces major changes on workout file processing to improve performances and ease the implementation of the next features:

  • data displayed in the workout chart are stored in the database,

  • and segments geometry is also stored.

This last change requires PostGIS extension, which adds geospatial capabilities to the PostgreSQL database.

Instructions for upgrade

Warning

These actions must be performed before upgrading to version 1.1.0.

Warning

Before upgrading, make a backup of all data:

Note

Depending on the operating system and the version of Python installed, additional dependencies may be required, such as gcc or libgdal-dev.

From PyPI or sources

PostGIS must be installed on your operating system. You can find instructions for your OS on PostGIS documentation.

Here are the instructions for installation on ArchLinux with yay (to adapt depending on your operating system):

  • stop the application and workers

  • install PostGIS on the server running the database

    $ yay postgis
    
  • add PostGIS extension to the database

    $ psql -U <SUPER_USER> -d <FITTRACKEE_DATABASE_NAME> -c 'CREATE EXTENSION IF NOT EXISTS postgis;'
    
  • if the server running the application is different from the server running the database, install gdal library on the server running the application (GDAL is installed with PostGIS)

    $ yay gdal
    
  • update fittrackee (see instructions for upgrade)

  • run database migrations

  • start application and workers

With Docker

  • stop the application, workers and database

    $ docker compose stop
    
  • change the database postgres image in docker-compose.yml to postgis/postgis (keep the same PostgreSQL version), for instance:

    -   image: postgres:17-alpine
    +   image: postgis/postgis:17-3.5-alpine
    

Warning

There is no official image for PostGIS on ARM platforms yet, see issue on GitHub.
The workaround is to build PostGIS image locally.
  • start only the database

    $ docker compose up fittrackee-db -d
    
  • add PostGIS extension to the database

    $ docker compose exec fittrackee-db psql -U <SUPER_USER> -d <FITTRACKEE_DATABASE_NAME> -c 'CREATE EXTENSION IF NOT EXISTS postgis;'
    CREATE EXTENSION
    
  • update fittrackee version in docker-compose.yml

  • start the application, migrations should run without error

Workouts data update

An new CLI option (--add-missing-geometry) allows to refresh workouts without geometry and chart data.

After upgrading fittrackee, run this command with other options depending on the number of workouts to update and the server capability, before enabling geospatial features on UI.

For instance to update the first 1,000 workouts created with a file:

$ ftcli workouts refresh --add-missing-geometry --per-page 1000 -v
This command can be re-executed until there are no more workouts to update.
Once all workouts have been updated, enable geospatial features on the interface by setting the environment variable ENABLE_GEOSPATIAL_FEATURES to True in .env.

Important

The version 1.1.0 requires all workouts to be updated (--add-missing-geometry option is removed in v1.1.0).