From 09a3107587474b5687704176b36e75001531f73d Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sun, 8 Aug 2010 15:38:33 +0200 Subject: [PATCH] Update MySQL -> Postgresql migration doc --- docs/manuals/en/main/postgresql.tex | 45 +++++++++++++++++------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/docs/manuals/en/main/postgresql.tex b/docs/manuals/en/main/postgresql.tex index 0d22a7be..7399eb79 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 -- 2.39.5