]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Do not reassign catalog objects after a migration
authorEric Bollengier <eric@baculasystems.com>
Thu, 12 May 2022 08:39:33 +0000 (10:39 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:58 +0000 (13:56 +0200)
The migration/copy process will re-recreate the catalog objects when we see
them on the Media.

bacula/src/dird/mac.c

index 932cb75d74b1d82b48fbffd17649485765cada00..271115f71af219a17769d5b0e9b054dcb38d1157 100644 (file)
@@ -831,15 +831,9 @@ void mac_cleanup(JCR *jcr, int TermCode, int writeTermCode)
            new_jobid, old_jobid);
          db_sql_query(wjcr->db, query.c_str(), NULL, NULL);
 
-         /* Move RestoreObjects */
-         Mmsg(query, "UPDATE RestoreObject SET JobId=%s WHERE JobId=%s",
-           new_jobid, old_jobid);
-         db_sql_query(wjcr->db, query.c_str(), NULL, NULL);
-
-         /* Move PluginObjects */
-         Mmsg(query, "UPDATE Object SET JobId=%s WHERE JobId=%s",
-           new_jobid, old_jobid);
-         db_sql_query(wjcr->db, query.c_str(), NULL, NULL);
+         /* We do not need to move RestoreObject, Object or Metadata because
+          * they are recreated during the migration process
+          */
 
          if (jcr->job->PurgeMigrateJob) {
             /* Purge old Job record */
@@ -870,6 +864,10 @@ void mac_cleanup(JCR *jcr, int TermCode, int writeTermCode)
          db_sql_query(wjcr->db, query.c_str(), NULL, NULL);
       }
 
+      /* We do not need to move RestoreObject, Object or Metadata because
+       * they are recreated during the copy process
+       */
+
       if (!db_get_job_record(jcr, jcr->db, &jcr->jr)) {
          Jmsg(jcr, M_WARNING, 0, _("Error getting Job record for Job report: ERR=%s"),
             db_strerror(jcr->db));