https://github.com/wuvt/mbslave
https://github.com/wuvt/mbslave
dockerfile musicbrainz
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/wuvt/mbslave
- Owner: wuvt
- Created: 2017-04-30T22:11:29.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-07-30T06:14:30.000Z (almost 6 years ago)
- Last Synced: 2025-11-09T12:22:54.983Z (8 months ago)
- Topics: dockerfile, musicbrainz
- Language: PLpgSQL
- Size: 759 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MusicBrainz Database Setup
This repository contains a collection of scripts that can help you setup a local
copy of the MusicBrainz database and keep it up to date. There is no script that
does everything for you though. The main motivation for writing these scripts was
to customize the database, so the way to install the database might differ from
user to user.
## Installation
0. Make sure you have [Python 2](http://python.org/) and [psycopg2](http://initd.org/psycopg/) installed.
On Debian and Ubuntu, that means installing these packages:
sudo apt install python python-psycopg2
1. Create `mbslave.conf` by copying and editing `mbslave.conf.default`.
You will need to get the API token on the [MetaBrainz website](https://metabrainz.org/supporters/account-type).
1. Setup the database. If you are starting completely from scratch,
you can use the following commands to setup a clean database:
sudo su - postgres
createuser musicbrainz
createdb -l C -E UTF-8 -T template0 -O musicbrainz musicbrainz
createlang plpgsql musicbrainz
psql musicbrainz -c 'CREATE EXTENSION cube;'
psql musicbrainz -c 'CREATE EXTENSION earthdistance;'
2. Prepare empty schemas for the MusicBrainz database and create the table structure:
echo 'CREATE SCHEMA musicbrainz;' | ./mbslave-psql.py -S
echo 'CREATE SCHEMA statistics;' | ./mbslave-psql.py -S
echo 'CREATE SCHEMA cover_art_archive;' | ./mbslave-psql.py -S
echo 'CREATE SCHEMA wikidocs;' | ./mbslave-psql.py -S
echo 'CREATE SCHEMA documentation;' | ./mbslave-psql.py -S
./mbslave-remap-schema.py >/var/log/mbslave.log
```
## Upgrading
When the MusicBrainz database schema changes, the replication will stop working.
This is usually announced on the [MusicBrainz blog](http://blog.musicbrainz.org/).
When it happens, you need to upgrade the database.
### Release 2019-05-13 (25)
Run the upgrade scripts:
```
./mbslave-remap-schema.py