Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/hotosm/tasking-manager/llms.txt

Use this file to discover all available pages before exploring further.

Major version upgrades to Tasking Manager may involve changes to the application stack, database schema, or both. Migrations are designed and tested by the core team but are not considered production-ready out of the box — environment-specific data volumes and configurations can introduce unexpected issues.
Always take a full database backup before beginning a migration and run the full process in a staging environment first. Verify that your staging instance behaves correctly before applying the migration to production. Do not skip this step — some migrations involve irreversible schema changes.

Migrate from Version 4 to Version 5

Version 5 is a major stack upgrade. The v4 backend was a synchronous application built with Flask and the psycopg2 database driver. Version 5 replaces this with an asynchronous FastAPI backend using asyncpg. No specific database schema changes are required for this migration, but the application server and startup command have changed.
1

Back up the database

Although no schema changes are required, a backup before any major transition is strongly recommended:
pg_dump -h <host> -p <port> -U <user> -d <dbname> -f ./backup.sql
For AWS RDS deployments, you can also take a manual snapshot from the RDS console before proceeding.
2

Pull the latest code

Use the main branch for the most stable release, or develop for the latest development build:
git fetch
git checkout main
git pull origin main
3

Rebuild and restart services

Rebuild the containers to pick up the new Dockerfile and Python dependencies:
docker compose --env-file tasking-manager.env up --build -d
The --env-file tasking-manager.env flag is important. Docker Compose uses .env as its default environment file, and the non-standard filename tasking-manager.env will not be loaded automatically. Omitting the flag can cause a database health-check warning about the PostgreSQL user not existing.
The tm-migration container runs alembic upgrade head automatically before the backend starts. Watch its logs to confirm migrations complete cleanly:
docker compose logs -f tm-migration
4

Switch from WSGI to ASGI

Version 5 is incompatible with WSGI servers such as gunicorn’s default worker class. The Dockerfile has been updated to use uvicorn as the ASGI server. If you have a custom startup command or init script referencing gunicorn, replace it with:
uvicorn backend.main:api \
  --host 0.0.0.0 \
  --port 5000 \
  --workers 8 \
  --log-level critical \
  --no-access-log
The TARGET_TAG build argument controls the Docker build target. Use debug for development and prod for production deployments:
TARGET_TAG=prod docker compose --env-file tasking-manager.env up --build -d
5

Verify the deployment

Confirm the API is responding correctly:
curl -f http://localhost:5000/api/docs
Check that the frontend loads in a browser and that you can authenticate with OSM OAuth2.

Build docs developers (and LLMs) love