0

I am working on Windows Server 2008 with the musicbrainz database dump. I unzipped the dump no problem and there are about 60 files with no extension whose names mirror the database tables.

I managed to get a createtables sql script I found at the github to work and I have a database schema with empty tables that mirror the files that I unzipped.

The problem is I am at the psql command line interface and I figured out how to issue the large object import command as per

\lo_import 'path/filename'

It seems to work because the files are very large and the moment I execute the CPU light starts blinking like mad. The problem is back in Postgres after I refresh my db the tables are still empty. I have no idea where that data goes if anywhere.

I am a straight up windows programmer (.NET/SQL/JQuery) so I need someone who can explain what's going on from this perspective. Explaining what works in unix or linux or anything other than windows will not be helpful I am afraid.

Milen A. Radev
  • 60,241
  • 22
  • 105
  • 110
  • 1
    Output from pg_dump is portable, but generally outputs a single file; file-system or PITR dumps have lots of files, but aren't portable between platforms. The fact that you have 60 files sounds like a potential problem. – kgrittn Apr 17 '12 at 12:41

2 Answers2

1

The recommended way to import our data dumps is to follow the instructions in the INSTALL file included with the musicbrainz server:

https://github.com/metabrainz/musicbrainz-server/blob/master/INSTALL

The "60 files with no extension" you mention are simple tab separated files, you may be able to import those manually using the postgresql COPY FROM command, but again, this is not recommended.

To get access to a musicbrainz database it may be easier to just get our virtual machine, see http://wiki.musicbrainz.org/MusicBrainz_Server/Setup

warp
  • 1,508
  • 15
  • 21
  • A working example of the COPY command or ANYTHING that would enable me to populate these empty tables would be helpful. I will not describe the awesome fail I experienced trying to mount the virtual machine but again, every instruction has been futile from documentation. I need to populate tables and COPY or anything explicity and concrete is the only thing that would be helpful. Thanks. – user1338710 Apr 17 '12 at 19:19
  • PS- The INSTALL page recommends the following: carton exec ./admin/InitDb.pl -- --createdb --import /tmp/dumps/mbdump*.tar.bz2 --echo & all I get from this is ERROR: syntax error at or near "carton" SQL state: 42601 Character: 1 - ** Further from the PSQL it seems to light up the CPU light but I do not get a magic musicbrainz db in Postgres :(( There is also no error. It just shows a new blank command prompt. – user1338710 Apr 17 '12 at 19:21
  • I am glad I posted here. Rather than enter the Postgres, Linux world and salsa dance down a slippery slope that at best eats up days and at worst fries my server it hit me like a ton of bricks, "the files are just tab delimited..." Woo hoo. There is a dinosaur called Visual FoxPro that can take any tab delimited file and eat it for breakfast while whistling a happy tune. This windows guy now truly understands why Microsoft is such a big gorilla; comparitively BEAUTIFUL documentation and a giant user base. Open source makes me miserable but musicbrainz is a GEM! Thanks sincerely for your help! – user1338710 Apr 17 '12 at 19:39
0

You can simply import sql dump data into your postgres db.

if you have already created DB then don't need to follow 1st step:-

STEP=1

open terminal then run following commands to create postgres database and user:-

sudo -u postgres psql

postgres=# create database mydb;

postgres=# create user myuser with encrypted password 'mypass';

postgres=# grant all privileges on database mydb to myuser;

STEP=2

\c used for selecting your database.

postgres=# \c yourdatabasename

\i used for importing dump data in database.

yourdatabasename=# \i path_of_your_dump_file for example:-

yourdatabasename=# \i /home/developer/projects/django_projects/db_dump.sql

If you face this type of error when you importing data:-

ERROR: role "yourusername" does not exist

so you can make superuser to your "db_user/yourusername" using this command:-

postgres=# ALTER USER fusion WITH SUPERUSER;

ALTER ROLE