MusicBrainz Server/Setup: Difference between revisions

From MusicBrainz Wiki
Jump to navigationJump to search
((Imported from MoinMoin))
 
m (→‎Requirements: Remove the required version of PostgreSQL, which was outdated and would like become outdated again, mention some other key software requirements)
 
(133 intermediate revisions by 27 users not shown)
Line 1: Line 1:
== Setup from Docker Compose ==
=Setting up a MusicBrainz Server=


This method is recommended as it makes install, setup, and maintenance much easier for you, to the cost of a small overhead compared to the size of the database.
[[Image:Attention.png]] Some data from ServerInstallationFAQ was moved here since the document did not contain any Q&A. This document probably needs some clean up now.


It can be used to:
If you are considering helping out with [[MusicBrainz]] server development, the first thing you will need to do is to set up your own [[Test Server|TestServer]] on your own machine. You will need to following things for this:
* Replicate the MusicBrainz website/web service/database,
* A linux box: A PIII-700 or better with 256MB RAM and 2Gb of free disk space is needed
* Test your own app that queries MusicBrainz web service,
* Apache, Perl, mod_perl, [[PostgreSQL]] and a number of perl modules
* Develop MusicBrainz Server itself.
* Familiarity with CVS to check out the server source code.
* Familiarity with compiling and installing packages from source on a Linux box.
* Familiarity with patching packages is also helpful -- we can help with this if needed.


See [https://github.com/metabrainz/musicbrainz-docker MusicBrainz Docker] and its [https://github.com/metabrainz/musicbrainz-docker/releases release notes].
If you meet the above requirements you should view the [http://cvs.musicbrainz.org/cvs/mb_server/INSTALL?rev=HEAD&content-type=text/vnd.viewcvs-markup complete installation instuctions] in [http://musicbrainz.org/development/cvs.html CVS]. If you don't meet all the requirements, but you have Linux box to work on and are serious about learning new skills, join us in the [http://musicbrainz.org/support/contact.html IRC channel] or post to [http://musicbrainz.org/list.html Musicbrainz-devel] and we will attempt to help out along when you get stuck.


== Setup from source code ==
There is more more information in how to install the server and load the correct dataset listed in ServerInstallationFAQ -- make sure to read this page before you download the mb_server module from CVS.
This can potentially be a very laborious and time consuming method of getting a functioning MusicBrainz server. Use it only if you cannot use MusicBrainz Docker for some reason (disk space, development, …).


Get a copy of musicbrainz-server from git:
If you don't have a spare Linux PC handy, you can download and use a [[Virtual MusicBrainz Server|VirtualMusicBrainzServer]].
git clone --recursive https://github.com/metabrainz/musicbrainz-server.git musicbrainz-server
cd musicbrainz-server
And follow the instructions in the [https://github.com/metabrainz/musicbrainz-server/blob/master/INSTALL.md INSTALL] file.


=== Support ===
The [[Server Beginners Guide|ServerBeginnersGuide]] may also be of use. [[Debian Server Setup|DebianServerSetup]] is a work-in-progress. [[Gentoo Server Setup|GentooServerSetup]] is just a note so far. If you just want the database, there are some notes on setting that up on [[MusicBrainz Database|MusicBrainzDatabase]].


We realize that this is a stiff set of requirements to get started, but please don't let this discourage you. The INSTALL file is thorough and contains a lot of information, and thus also looks daunting. We recommend that you dive in and give it a try -- who knows how far you'll get and what you might learn along the way.
The setup process may look daunting, but please don't let this discourage you; the INSTALL is thorough and contains a lot of information, and we are willing to provide assistance. If you have questions about installing, join us in the [http://webchat.freenode.net/?channels=metabrainz #metabrainz IRC channel] or post a question on the [https://community.metabrainz.org/tags/musicbrainz-server community forum] and we will attempt to help you out.


We recommend that you dive in and give it a try - who knows how far you'll get and what you might learn along the way!
Once you get the [[MusicBrainz]] server running, dive in and tackle a task on the [[Development To Do List|DevelopmentToDoList]] or send us mail via the [http://musicbrainz.org/about/helpwanted.html help wanted page].


===Requirements===
==Download and Importing MusicBrainz Data==


1. Download the code which matches whatever the [[MusicBrainz]] server is currently running.
In order to set up a running MusicBrainz server with the full database you will need:
* A linux box, preferably Ubuntu.
* On [http://www.musicbrainz.org/development/cvs-modules.html http://www.musicbrainz.org/development/cvs-modules.html], find the tag of the live version, e.g. "RELEASE_20040509-BRANCH". On that page it's next to the words "this version".
* 60GB+ of free disk space, (if you are a developer and only want the server code and database structure 2GB+ should do, count 6GB+ if you want sample data).
* Follow the instructions for how to get code from CVS, as listed here: [http://www.musicbrainz.org/development/cvs.html http://www.musicbrainz.org/development/cvs.html] - BUT you need to specify the tag on the command line, like this:
* [[Git]] knowledge which will enable you to check out the source code.
* PostgreSQL, Perl, Node.js, and some other dependencies (See [https://github.com/metabrainz/musicbrainz-server/blob/master/INSTALL.md#prerequisites all software prerequisites])


As a developer the following knowledge/skills are beneficial:
<pre> cvs -z3 checkout -P -r ''RELEASE_20040509-BRANCH'' mb_server
* Perl and a number of perl modules, PostgreSQL, React/JSX.
</pre>
* How to compile and install packages from source on a Linux box.
* How to patch existing packages, although we can help you out if you have questions about that.


Note: The server has ''never been ported to Windows'', and we suspect that it would be a fair amount of work to make that happen.
2. Prerequisite: Postgres, at least version 7.3


==External Links==
You'll need a running copy of Postgres >= 7.3. It will help if you've got Postgres set up so that whatever user you're running as can connect (both as "postgres" and as your preferred database user) without a password.
* [https://github.com/metabrainz/musicbrainz-server MusicBrainz Server] on GitHub
** List of [https://blog.metabrainz.org/category/musicbrainz+server/?tag=changelog MusicBrainz Server updates] on the MetaBrainz blog
** List of supplemental [http://blog.musicbrainz.org/category/musicbrainz+server/?tag=instructions instructions] on the MetaBrainz blog


* [https://github.com/metabrainz/musicbrainz-server MusicBrainz Docker] on GitHub
3. Download a data dump
** List of [https://blog.metabrainz.org/category/musicbrainz+virtual-machine/ MusicBrainzB Virtual Machine releases] on the MetaBrainz blog
** List of [https://github.com/metabrainz/musicbrainz-server/releases MusicBrainz Docker releases] on GitHub


[[Category:WikiDocs Page]] [[Category:Download]] [[Category:Development]] [[Category:Server]]
Go to [http://ftp.musicbrainz.org/pub/musicbrainz/data/fullexport/ http://ftp.musicbrainz.org/pub/musicbrainz/data/fullexport/] Go into whichever directory is marked as "latest". Download all the files in there.

(It doesn't have to be all, but for simplicity's sake we'll go with "all" for now). For a minimal setup, at least mbdump.tar.bz2 and mbdump-derived.tar.bz2 are required.

4. Import the data!

<pre>$ cd mb_server
</pre>

<pre>$ ./admin/InitDb.pl --createdb --echo --import /your/downloaded/mbdump*.tar.bz2
</pre>

==Database import tips==

I was having various problems with importing the database. The following seems to work for me: <pre>(as user postgres)
initdb -E UNICODE --locale=C
(then edit pg_hba.conf & pg_ident.conf & start postgres)
createdb musicbrainz_db
createuser musicbrainz_user
createlang plpgsql -d musicbrainz_db
(as user www-data)
./admin/InitDb.pl --import mbdump*.tar.bz2
</pre>

I spoke too soon - I've got further than before, but still haven't completed the import...

--[[User:ZeroGravitas|ZeroGravitas]]

==Notes==

* The server has never been ported to Windows, and we suspect that it would be a fair amount of work to make that happen.
* You don't actually need to know SQL/Perl to setup the server. But if you plan on adding features to [[MusicBrainz]], you will need Perl experience and likely also SQL experience.

+ there also is a [http://www.musicbrainz.org/products/server/docs/20030820-1/index.html graphic of the database structure] that might help you

[[Category:To Be Reviewed]] [[Category:Development]]

Latest revision as of 19:58, 28 March 2023

Setup from Docker Compose

This method is recommended as it makes install, setup, and maintenance much easier for you, to the cost of a small overhead compared to the size of the database.

It can be used to:

  • Replicate the MusicBrainz website/web service/database,
  • Test your own app that queries MusicBrainz web service,
  • Develop MusicBrainz Server itself.

See MusicBrainz Docker and its release notes.

Setup from source code

This can potentially be a very laborious and time consuming method of getting a functioning MusicBrainz server. Use it only if you cannot use MusicBrainz Docker for some reason (disk space, development, …).

Get a copy of musicbrainz-server from git:

git clone --recursive https://github.com/metabrainz/musicbrainz-server.git musicbrainz-server
cd musicbrainz-server

And follow the instructions in the INSTALL file.

Support

The setup process may look daunting, but please don't let this discourage you; the INSTALL is thorough and contains a lot of information, and we are willing to provide assistance. If you have questions about installing, join us in the #metabrainz IRC channel or post a question on the community forum and we will attempt to help you out.

We recommend that you dive in and give it a try - who knows how far you'll get and what you might learn along the way!

Requirements

In order to set up a running MusicBrainz server with the full database you will need:

  • A linux box, preferably Ubuntu.
  • 60GB+ of free disk space, (if you are a developer and only want the server code and database structure 2GB+ should do, count 6GB+ if you want sample data).
  • Git knowledge which will enable you to check out the source code.
  • PostgreSQL, Perl, Node.js, and some other dependencies (See all software prerequisites)

As a developer the following knowledge/skills are beneficial:

  • Perl and a number of perl modules, PostgreSQL, React/JSX.
  • How to compile and install packages from source on a Linux box.
  • How to patch existing packages, although we can help you out if you have questions about that.

Note: The server has never been ported to Windows, and we suspect that it would be a fair amount of work to make that happen.

External Links