Skip to content

Instantly share code, notes, and snippets.

@notEvil
Created August 26, 2016 09:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save notEvil/be975e41693b88e0e5587fbf1dbe2ce3 to your computer and use it in GitHub Desktop.
Save notEvil/be975e41693b88e0e5587fbf1dbe2ce3 to your computer and use it in GitHub Desktop.
Musicbrainz VM upgrade to 23
# With the following commands I upgraded the current VM (2015-08-06) so it would import the current db dumps (Schema 23).
# Please follow the script step by step. It is not an automated script but rather a sequence of commands and instructions.
# You certainly have to adjust the postgres install section to your distro, the git tag to check out, and the import section at the end.
# https://github.com/metabrainz/musicbrainz-server/blob/master/INSTALL.md
cd /home/musicbrainz/musicbrainz-server
## update postgresql
sudo apt-get remove --purge postgresql-9.3 postgresql-client-9.3 postgresql-contrib-9.3 postgresql-musicbrainz-collate postgresql-musicbrainz-unaccent
# https://www.postgresql.org/download/linux/ubuntu/
echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" | sudo tee -a /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | \
sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-9.5 postgresql-server-dev-9.5 postgresql-contrib-9.5
## update mb-server
# https://blog.musicbrainz.org/2016/05/25/schema-change-release-2016-05-23-with-upgrade-instructions/
sudo git fetch origin
tag=v-2016-08-01
sudo git checkout ${tag}
## install postgresql extensions
cd ..
sudo git clone https://github.com/metabrainz/postgresql-musicbrainz-collate.git
cd postgresql-musicbrainz-collate
sudo make install
cd ..
sudo git clone https://github.com/metabrainz/postgresql-musicbrainz-unaccent.git
cd postgresql-musicbrainz-unaccent
sudo make install
cd musicbrainz-server
## set db schema sequence to 23, replication type to RT_STANDALONE
sudo vim lib/DBDefs.pm
## set postgresql permission
# insert "local all all trust"
sudo vim /etc/postgresql/9.5/main/pg_hba.conf
## update db
sudo dropdb -U musicbrainz musicbrainz
base=/media/sf_Downloads
sudo ./admin/InitDb.pl --createdb --import ${base}/mbdump.tar.bz2 ${base}/mbdump-derived.tar.bz2 --echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment