Bacula-users

[Bacula-users] converting from MySQL to Postgresql

2010-06-22 06:32:00
Subject: [Bacula-users] converting from MySQL to Postgresql
From: Jon Schewe <jpschewe AT mtu DOT net>
To: bacula-users AT lists.sourceforge DOT net
Date: Tue, 22 Jun 2010 05:26:18 -0500
I've seen quite a bit of discussion on this on the list. It seems
possible, so I figured I'd try. I'm using a combination of
http://www.bacula.org/manuals/en/catalog/catalog/Installi_Configur_PostgreS.html#1107
and
http://www.mail-archive.com/bacula-users AT lists.sourceforge DOT 
net/msg40993.html

I did
mysqldump -t -n -c --compatible=postgresql --skip-quote-names --skip-opt
--disable-keys --lock-tables -u bacula -ppass bacula

cat bacula-backup.dmp | sed -e 's/0000-00-00 00:00:00/1970-01-01
00:00:00/g' > fixed-bacula-backup.sql
psql -h localhost -U bacula bacula fixed-bacula-backup.sql

Then tried to import fixed-bacula-backup.sql into the postgresql tables
created by the bacula setup scripts. Things went along pretty well until
I ran into this:
2010-06-21 22:55:01 CDT bacula bacula WARNING:  nonstandard use of
escape in a string literal at character 89
2010-06-21 22:55:01 CDT bacula bacula HINT:  Use the escape string
syntax for escapes, e.g., E'\r\n'.
2010-06-21 22:55:01 CDT bacula bacula ERROR:  invalid byte sequence for
encoding "SQL_ASCII": 0x00
2010-06-21 22:55:01 CDT bacula bacula HINT:  This error can also happen
if the byte sequence does not match the encoding expected by the server,
which is controlled by "client_encoding".
2010-06-21 22:55:01 CDT bacula bacula STATEMENT:  INSERT INTO Log
(LogId, JobId, Time, LogText) VALUES (456892,5599,'1969-12-31
18:00:01','jon-fd JobId 5599: -rw-rw-r--   1 33       video       727636
2010-02-14 14:51:04 
/mnt/mybook//home/httpd/html/gallery/albums/osseo1994/DSC_0066_066.jpg\n\0');

and then:
2010-06-21 23:01:15 CDT bacula bacula ERROR:  duplicate key value
violates unique constraint "status_pkey"
2010-06-21 23:01:15 CDT bacula bacula STATEMENT:  INSERT INTO Status
(JobStatus, JobStatusLong, Severity) VALUES ('p','Waiting on higher
priority jobs',15);

Any hints?

-- 
Jon Schewe | http://mtu.net/~jpschewe
If you see an attachment named signature.asc, this is my digital
signature. See http://www.gnupg.org for more information.


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users

<Prev in Thread] Current Thread [Next in Thread>