As we announced in February, in two weeks time (May 18, 2020) we’ll be upgrading our production database server to PostgreSQL v12 (from v9.5). At the same time, v12 will become the minimum supported version for MusicBrainz Server, so we ask that you upgrade afterwards as soon as possible! If you’re still unsure, a Q&A is below.
When do I need to upgrade my postgres by?
As soon as possible after May 18 if you’d like to keep your musicbrainz-server code up to date.
How do I perform the upgrade?
We’ll provide instructions closer to May 18. It’s recommended that you don’t upgrade until then, since we’ll be providing scripts to resolve some issues.
Will the live data feed (replication packets) stop working right away if I don’t upgrade?
No, as long as you keep your musicbrainz-server code checkout on the
v-2020-05-11 tag (which will be the final release before May 18) or earlier. Future releases may work for a while too.
This is not a schema change release, so replication will continue to work smoothly until you upgrade. No tables or views will change.
However, to make the upgrade process smoother we’ll be dropping the musicbrainz-collate and musicbrainz-unaccent extensions, instead using PG’s builtin collation support for the former and replacing the latter with the unaccent extension from postgresql-contrib. A few SQL functions are being added to enable this, and some indexes need to be rebuilt. This will all happen as part of upgrade scripts we provide (or you can import from scratch). Some features of musicbrainz-server that use these old extensions may cease to work if you don’t apply them.
The extension changes above don’t actually make use of any new PG 12 features. We’ll avoid using such features for at least 1 month.
If I’m already running PostgreSQL 12, do I need to do anything?
Yes, but things will be easier for you. As mentioned in the previous answer, we’ll be dropping the musicbrainz-collate and musicbrainz-unaccent extensions to make the upgrade process smoother for pre-v12 instances. So you’ll only have to run some upgrade scripts we provide to replace those extensions and rebuild some indexes.
My host/distribution doesn’t have PostgreSQL 12 yet!
If you’re running Debian or Ubuntu, the PGDG maintains an APT repository with the latest versions. These are the same packages MetaBrainz uses in production.
Amazon RDS supports PostgreSQL 12 since March 31.
I absolutely cannot upgrade yet! What should I do?
You can stay on the
v-2020-05-11 release of musicbrainz-server or earlier until then. Replication packets (i.e. the live data feed) will continue to work until the next schema change on that tag, but you’ll have upgraded to v12 by then, right?
Instead of performing a
pg_upgrade and running these upgrade scripts you mentioned, can I just import fresh data dumps into a new v12 cluster?
Of course. Just make sure your musicbrainz-server git checkout is on the
v-2020-05-18 tag (once that’s released) or later before performing the import. And keep in mind it may be slower than a direct upgrade.