MusicBrainz NGS Database Install for Mac: Difference between revisions

From MusicBrainz Wiki
Jump to navigationJump to search
Line 10: Line 10:


Download postgres8.3 source and unzip
Download postgres8.3 source and unzip
Build and install
<pre>
./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test
</pre>


Build and install Postgres and Cube extension required by Musicbrainz
Build and install Postgres and Cube extension required by Musicbrainz
<pre>
<pre>
gmake
cd contrib/cube
cd contrib/cube
gmake
gmake

Revision as of 22:41, 3 January 2011

Setting up Postgres for Musicbrainz on a Mac System

Install MacPorts

Now install gmake using MacPorts

port gmake


Download postgres8.3 source and unzip Build and install

./configure
gmake
su
gmake install
adduser postgres
mkdir /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 &
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

Build and install Postgres and Cube extension required by Musicbrainz

cd contrib/cube
gmake 
sudo gmake install
pg_config
cd /usr/local/pgsql/share/contrib
psql -d musicbrainz -U musicbrainz -f cube.sql

Reboot, start Postgres Server (because if built from source wont be started automatically, Best to put this command in a script in postgres users home dir)

sudo - postgres/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start

Install pgadmin

Run pgadmin check can connect to server then create user musicbrainz

I then followed [[1]http://wiki.musicbrainz.org/Database_Installation] but had to make some changes for NGS release as follows

Just interested in mbdump and mpdump-cdstubs (cdstubs) and mbdump-derived (annotations, tags)

Create one database called musicbrainz and use it for both main and raw database

Edit admin/sql/CreateIndexes.sql removing the page indexes and musicbrainz_collate indexes

Also need to run admin/sql/vertical/rawdata/CreateTable.sql, CreatePrimaryKeys.sql and CreateIndexes.sql

for t in *; do echo `date` $t ; echo "\\copy $t from ./$t" | /usr/local/pgsql/bin/psql -U musicbrainz musicbrainz && mv $t ../done/; done; echo `date` Done

When build indexes modify IndexOptions.prepareDbConnection to not use a schema because schema is not used with the above instructions