Breaking changes
This release upgrades the MusicBrainz database schema version to 30. It requires to run commands taking down all services during the upgrade.
Disk space requirement has been readjusted: 350 GB (or 100 GB without indexed search), system included.
If your musicbrainz-docker
is earlier than v-2024-05-13-mbdb29-pg16
, you must first update to it (see its release notes) and follow the upgrade instructions below, or remove everything using sudo docker-compose down --rmi local --volumes
and reinstall.
Upgrade instructions
Assuming your checked out version of musicbrainz-docker
is v-2024-05-13-mbdb29-pg16
or later, then:
-
Ensure you’ve replicated up to the most recent replication packet available with the old schema 29. If you’re not sure, run:
sudo docker-compose exec musicbrainz bash -c 'carton exec -- ./admin/replication/LoadReplicationChanges'
and see what it tells you; if you’re ready to upgrade, it should say “This replication packet matches schema sequence #30, but the database is currently at #29.”
-
Turn off cron jobs:
admin/configure rm replication-cron sudo docker-compose up -d musicbrainz
-
Switch to the new code with:
git fetch --tags origin git checkout v-2025-05-20.0-mbdb30
-
Upgrade the MusicBrainz database schema:
mkdir -p local/compose/ && cp -a admin/lib/upgrade-db-schema/musicbrainz-stopped.yml local/compose/ admin/configure add local-compose-musicbrainz-stopped sudo docker-compose build musicbrainz sudo docker-compose up -d musicbrainz # Temporary workaround for MBS-14032 sudo docker-compose exec musicbrainz bash -c 'carton exec -- ./admin/BuildMaterializedTables --database=MAINTENANCE all' sudo docker-compose exec musicbrainz upgrade-db-schema.sh
Building materialized tables is a workaround to avoid the reported bug MBS-14032. This workaround does take some time and disk usage. A patched release will be made available as soon as possible to make this workaround unnecessary.
The rest of this step took ~12min with 4GB of shared buffers during tests. The following lines are expected and can be safely ignored:
This is an optional step. If you had previously built materialized tables, a few of them have to be rebuilt:
Load the first replication packet available with the new schema 30:
and see what it tells you; if the upgrade, it should say “This packet was produced (or begins) at 2025-05-19 18:59:03.681755+00”
The following lines are expected and can be safely ignored (for the first packet only):
Turn cron jobs back on:
Restart all services:
P.S. Search upgrades will occur in a separate release.
At the end it should say “Done” followed with a message that you can safely ignore as handled already: “UPDATE THE DB_SCHEMA_SEQUENCE IN DBDefs.pm TO 30 !”
Troubleshooting
NOTICE: trigger "…" for relation "…" does not exist, skipping
sudo docker-compose exec musicbrainz bash -c 'carton exec -- ./admin/BuildMaterializedTables --database=MAINTENANCE recording_first_release_date artist_release artist_release_group'
sudo docker-compose exec musicbrainz bash -c 'carton exec -- ./admin/replication/LoadReplicationChanges --limit=1'
Troubleshooting
The current row in musicbrainz.replication_control with key id='1' contains a different value in column current_schema_sequence (30) than the replication packet suggests it should have as the old value (29). at /musicbrainz-server/admin/replication/ProcessReplicationChanges line 497.
WARNING: amqp could not commit tx mode on broker 1, reply_type=2, library_errno=4
admin/configure rm local-compose-musicbrainz-stopped
admin/configure add replication-cron
sudo docker-compose up -d musicbrainz
Changes
v-2024-05-19.0-schema-change
(release notes)