Saturday 15 June 2013

mediawiki - How can I use mwdumper with Postgresql command line -



mediawiki - How can I use mwdumper with Postgresql command line -

i importing mediawiki database using mwdumper mysql. need same thing, using postgresql.

basicly archive in link:

http://dumps.wikimedia.org/enwiki/20140903/

and utilize mwdumper programme informations , set in database.

this database script:

https://git.wikimedia.org/blob/mediawiki%2fcore.git/head/maintenance%2fpostgres%2ftables.sql

i created database through sql, , need utilize mwdumper set info in database. saw many links this, in mysql.

anyone know how import using postgres, using command line?

mwdumper: www.mediawiki.org/wiki/manual:mwdumper

i forgot question, found solution, command line utilize mwdumper postgres is:

java -jar mwdumper-1.16.jar --format=pgsql:1.5 archive.xml.gz | psql -u wikiuser -d wikidatabase

the command isn't wrong, errors happen because mwdumper-1.16 convert xml sql wrong sintaxe.

this insert sql after convert mwdumper (xml->postgresql):

insert revision (rev_id,rev_page,rev_text_id,rev_comment,rev_user,rev_user_text,rev_timestamp,rev_minor_edit,rev_deleted) values (378187747,676,378187747,'there no such thing \"jr.\" in russian names. sincerely yours, x\\'zz\\'',0,'198.240.130.75','2010-08-10 14:55:48',0,0);

analizing same insert in info base of operations mysql, expected text in postgres is:

insert (...) ,' there no such thing "jr." in russian names. sincerely yours, x\''zz\'' ', (...).

for example: represent double quotes, mwdumper give sintaxe \" , represent " in postgres doesn't have \ , it's ". same thought others sintaxe errors.

when solve sintaxe errors can dump perfectly.

postgresql mediawiki dump

No comments:

Post a Comment