Index: /trunk/ippTools/src/pzgetimfiles.c
===================================================================
--- /trunk/ippTools/src/pzgetimfiles.c	(revision 10062)
+++ /trunk/ippTools/src/pzgetimfiles.c	(revision 10063)
@@ -417,4 +417,36 @@
         }
     }
+
+    // cp the pzPendingExp entry to pzDoneExp
+    {
+        char *query = 
+            "INSERT INTO pzDoneExp"
+            "   SELECT"
+            "       pzPendingExp.*"
+            "   FROM pzPendingExp"
+            "   WHERE"
+            "       pzPendingExp.exp_id = '%s'"
+            "       AND pzPendingExp.camera = '%s'"
+            "       AND pzPendingExp.telescope = '%s'";
+        if (!p_psDBRunQuery(config->dbh, query, filesetid, camera, telescope)) {
+            // rollback
+            if (!psDBRollback(config->dbh)) {
+                psError(PS_ERR_UNKNOWN, false, "database error");
+            }
+            psError(PS_ERR_UNKNOWN, false, "database error");
+            return false;
+        }
+ 
+        // sanity check: we should have inserted only one row
+        psU64 affected = psDBAffectedRows(config->dbh);
+        if (psDBAffectedRows(config->dbh) != 1) {
+            // rollback
+            if (!psDBRollback(config->dbh)) {
+                psError(PS_ERR_UNKNOWN, false, "database error");
+            }
+            psError(PS_ERR_UNKNOWN, false, "should have affected 1 row but %" PRIu64 " rows were modified", affected);
+            return false;
+        }
+    }
  
     // remove the pzPendingExp entry for this exp (fileset)
