From: Eric Bollengier Date: Sun, 8 Aug 2010 13:36:37 +0000 (+0200) Subject: Update Mysql to PostgreSQL procedure X-Git-Tag: Release-5.2.1~89 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9bbc91b2ae309c11cfc9fad442d076c7b8ea5760;p=bacula%2Fdocs Update Mysql to PostgreSQL procedure --- diff --git a/docs/manuals/en/main/postgresql.tex b/docs/manuals/en/main/postgresql.tex index b2ff89c8..80e87cc3 100644 --- a/docs/manuals/en/main/postgresql.tex +++ b/docs/manuals/en/main/postgresql.tex @@ -372,8 +372,11 @@ before proceeding with this process! \footnotesize \begin{verbatim} - mysqldump -f -t -n >bacula-backup.dmp - +mysqldump -t -n -c --compatible=postgresql --skip-quote-names --skip-opt \ + --disable-keys --lock-tables -u bacula -ppassword bacula \ + | grep -v "INSERT INTO Status" \ + | sed -e 's/0000-00-00 00:00:00/1970-01-01 00:00:00/g' \ + | sed -e 's/\\0//' > bacula-backup.sql \end{verbatim} \normalsize @@ -445,26 +448,32 @@ psql -Ubacula bacula \begin{verbatim} psql -Ubacula bacula -SELECT SETVAL('basefiles_baseid_seq', (SELECT -MAX(baseid) FROM basefiles)); -SELECT SETVAL('client_clientid_seq', (SELECT -MAX(clientid) FROM client)); -SELECT SETVAL('file_fileid_seq', (SELECT MAX(fileid) -FROM file)); -SELECT SETVAL('filename_filenameid_seq', (SELECT -MAX(filenameid) FROM filename)); - -SELECT SETVAL('fileset_filesetid_seq', (SELECT -MAX(filesetid) FROM fileset)); - +SELECT SETVAL('basefiles_baseid_seq', (SELECT MAX(baseid) FROM basefiles)); +SELECT SETVAL('client_clientid_seq', (SELECT MAX(clientid) FROM client)); +SELECT SETVAL('file_fileid_seq', (SELECT MAX(fileid) FROM file)); +SELECT SETVAL('filename_filenameid_seq', (SELECT MAX(filenameid) FROM filename)); +SELECT SETVAL('fileset_filesetid_seq', (SELECT MAX(filesetid) FROM fileset)); SELECT SETVAL('job_jobid_seq', (SELECT MAX(jobid) FROM job)); -SELECT SETVAL('jobmedia_jobmediaid_seq', (SELECT -MAX(jobmediaid) FROM jobmedia)); +SELECT SETVAL('jobmedia_jobmediaid_seq', (SELECT MAX(jobmediaid) FROM jobmedia)); +SELECT SETVAL('media_mediaid_seq', (SELECT MAX(mediaid) FROM media)); +SELECT SETVAL('path_pathid_seq', (SELECT MAX(pathid) FROM path)); +SELECT SETVAL('basefiles_baseid_seq', (SELECT MAX(baseid) FROM basefiles)); +SELECT SETVAL('client_clientid_seq', (SELECT MAX(clientid) FROM client)); +SELECT SETVAL('file_fileid_seq', (SELECT MAX(fileid) FROM file)); +SELECT SETVAL('filename_filenameid_seq', (SELECT MAX(filenameid) FROM filename)); +SELECT SETVAL('fileset_filesetid_seq', (SELECT MAX(filesetid) FROM fileset)); +SELECT SETVAL('job_jobid_seq', (SELECT MAX(jobid) FROM job)); +SELECT SETVAL('jobmedia_jobmediaid_seq', (SELECT MAX(jobmediaid) FROM jobmedia)); SELECT SETVAL('media_mediaid_seq', (SELECT MAX(mediaid) FROM media)); SELECT SETVAL('path_pathid_seq', (SELECT MAX(pathid) FROM path)); - SELECT SETVAL('pool_poolid_seq', (SELECT MAX(poolid) FROM pool)); - + +SELECT SETVAL('device_deviceid_seq', (SELECT MAX(deviceid) FROM device)); +SELECT SETVAL('location_locationid_seq', (SELECT MAX(locationid) FROM location)); +SELECT SETVAL('locationlog_loclogid_seq', (SELECT MAX(loclogid) FROM locationlog)); +SELECT SETVAL('log_logid_seq', (SELECT MAX(logid) FROM log)); +SELECT SETVAL('mediatype_mediatypeid_seq', (SELECT MAX(mediatypeid) FROM mediatype)); +SELECT SETVAL('storage_storageid_seq', (SELECT MAX(storageid) FROM storage)); \end{verbatim} \normalsize