|
| 1 | +!!! note "After upgrading from Codabench <1.24.0, you will need to perform important manual interventions." |
| 2 | + |
| 3 | +## Rabbit |
| 4 | +We also need to log into the RabbitMQ interface and enable the flags it wants us to enable after upgrading. |
| 5 | + |
| 6 | +RabbitMQ port, username and password to access the interface are defined in the `.env` file. |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | +More information about feature flags [here](https://www.rabbitmq.com/docs/feature-flags) |
| 11 | + |
| 12 | + |
| 13 | +## Database (Postgres 12 -> 18) |
| 14 | +### 1. Maintenance mode on to avoid update on the database during the upgrade: |
| 15 | + |
| 16 | +```sh |
| 17 | +touch maintenance_mode/maintenance.on |
| 18 | +git pull |
| 19 | +``` |
| 20 | + |
| 21 | +### 2. Create the new `postgres.conf` file from the sample: |
| 22 | + |
| 23 | +```sh |
| 24 | +cp my-postgres_sample.conf my-postgres.conf |
| 25 | +``` |
| 26 | + |
| 27 | +### 3. Rebuild docker containers to take into account the new images: |
| 28 | + |
| 29 | +```sh |
| 30 | +docker compose build --no-cache |
| 31 | +``` |
| 32 | + |
| 33 | +### 4. Dump the database, remove it and reload it on the new configuration: |
| 34 | + |
| 35 | +```sh |
| 36 | +# Dump database |
| 37 | +docker compose exec db bash -lc 'PGPASSWORD="$DB_PASSWORD" pg_dump -Fc -U "$DB_USERNAME" -d "$DB_NAME" -f /app/backups/upgrade-1.24.dump' |
| 38 | +``` |
| 39 | + |
| 40 | +```sh |
| 41 | +# Check that dump file is not empty |
| 42 | +docker compose exec db bash -lc 'ls -lh /app/backups/upgrade-1.24.dump && pg_restore -l /app/backups/upgrade-1.24.dump | head' |
| 43 | +``` |
| 44 | + |
| 45 | +**/!\ Dangerous operation here: confirm that your dump worked before removing the database!** |
| 46 | + |
| 47 | +```sh |
| 48 | +# Remove database |
| 49 | +sudo rm -rf var/postgres |
| 50 | +``` |
| 51 | + |
| 52 | +```sh |
| 53 | +# Launch the new containers (containing the updated databse image and Restore from backup) |
| 54 | +docker compose up -d db |
| 55 | +docker compose exec db bash -lc 'PGPASSWORD="$DB_PASSWORD" pg_restore --verbose --clean --no-acl --no-owner -h $DB_HOST -U "$DB_USERNAME" -d "$DB_NAME" /app/backups/upgrade-1.24.dump' |
| 56 | +``` |
| 57 | + |
| 58 | +_See [this](https://www.postgresql.org/docs/18/upgrading.html) for more details._ |
| 59 | + |
| 60 | +### 5 Restart the rest of the services and disable maintenance mode: |
| 61 | + |
| 62 | +```sh |
| 63 | +docker compose up -d |
| 64 | +rm maintenance_mode/maintenance.on |
| 65 | +``` |
| 66 | + |
0 commit comments