Updating
The Updating process depends on your chosen method of installation
While intermediate updates can be skipped when updating please make sure to read the release notes in case some special action is required to update.
Docker
For all setups using Docker the updating process look something like this
- Before updating it is recommended to create a backup!
- Stop the container using
docker-compose down
- Pull the latest image using
docker-compose pull
- Start the container again using
docker-compose up -d
Manual
For all setups using a manual installation updates usually involve downloading the latest source code from GitHub. After that make sure to run:
pip install -r requirements.txt
manage.py collectstatic
manage.py migrate
cd ./vue
yarn install
yarn build
To install latest libraries, apply all new migrations and collect new static files.
PostgreSQL
Postgres does not automatically upgrade database files when you change versions and requires manual intervention. One option is to manually backup/restore the database.
A full list of options to upgrade a database provide in the official PostgreSQL documentation.
- Collect information about your environment.
grep -E 'POSTGRES|DATABASE' ~/.docker/compose/.env
docker ps -a --format 'table {{.ID}}\t{{.Names}}\t{{.Image}}\t{{.Status}}' | awk 'NR == 1 || /postgres/ || /recipes/'
- Export the tandoor database
docker exec -t {{database_container}} pg_dumpall -U {{djangouser}} > ~/tandoor.sql
-
Stop the postgres container
docker stop {{database_container}} {{tandoor_container}}
-
Rename the tandoor volume
sudo mv -R ~/.docker/compose/postgres ~/.docker/compose/postgres.old
- Update image tag on postgres container.
db_recipes:
restart: always
image: postgres:16-alpine
volumes:
- ./postgresql:/var/lib/postgresql/data
env_file:
- ./.env
- Pull and rebuild container.
docker-compose pull && docker-compose up -d
- Import the database export
cat ~/tandoor.sql | sudo docker exec -i {{database_container}} psql postgres -U {{djangouser}}
docker exec -it {{database_container}} psql
CREATE EXTENSION IF NOT EXISTS unaccent;
CREATE EXTENSION IF NOT EXISTS pg_trgm;
If anything fails, go back to the old postgres version and data directory and try again.
There are many articles and tools online that might provide a good starting point to help you upgrade 1, 2, 3.