Bacula-users

Re: [Bacula-users] PostgreSQL: import of DB from MySQL fails

2012-12-29 05:06:30
Subject: Re: [Bacula-users] PostgreSQL: import of DB from MySQL fails
From: Andrea Conti <alyf AT alyf DOT net>
To: bacula-users AT lists.sourceforge DOT net
Date: Sat, 29 Dec 2012 10:35:48 +0100
> Hm... with "--compatible=postgresql" the backtics get changed into '"'
> characters, but the errors essentially remain the same:
> 
> ERROR:  syntax error at or near ""BaseFiles""
> LINE 1: LOCK TABLES "BaseFiles" WRITE;
>                     ^
> ERROR:  syntax error at or near "UNLOCK"
> LINE 1: UNLOCK TABLES;

Postgres has a different syntax for the LOCK command, and has no UNLOCK.
You can safely remove LOCK/UNLOCK commands as they're not needed in this
scenario.

> ERROR:  relation "Client" does not exist
> LINE 1: INSERT INTO "Client" VALUES (1,'diddl-fd','5.2.12 (12Sep12) ...

You must create the tables before inserting data. You can either tell
mysqldump to also dump the db schema (but you will have to review the
CREATE TABLE statements as there are differences in type names) or
create the schema using the postgres SQL script which comes with bacula.

If you manage to insert all data in the new db, be sure to validate it
by performing a test restore.

Depending on your setup, you could also consider creating an empty
database and bscanning all existing volumes into it.

HTH
andrea

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122912
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users