diff --git a/debian/scripts/help_database_update_scripts_extractor_v13.patch b/debian/scripts/help_database_update_scripts_extractor_v13.patch
index 3ae5287c..e69de29b 100644
--- a/debian/scripts/help_database_update_scripts_extractor_v13.patch
+++ b/debian/scripts/help_database_update_scripts_extractor_v13.patch
@@ -1,39 +0,0 @@
-diff --git a/src/cats/update_mysql_tables.in b/src/cats/update_mysql_tables.in
-index f4b3f9e4..a66f043d 100644
---- a/src/cats/update_mysql_tables.in
-+++ b/src/cats/update_mysql_tables.in
-@@ -30,8 +30,9 @@ ARGS=$*
- 
- getVersion()
- {
--    mysql $ARGS -D ${db_name} -e "select VersionId from Version LIMIT 1\G" >/tmp/$$
--    DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$`
-+    if test -f $OUTFILE; then
-+	DBVERSION=`grep "UPDATE Version SET VersionId" $OUTFILE | tail -n 1 | sed 's/^[^0-9]*\([0-9][0-9]*\)[^0-9]*;/\1/'`
-+    fi
- }
- 
- getVersion
-diff --git a/src/cats/update_sqlite3_tables.in b/src/cats/update_sqlite3_tables.in
-index 2a5efd72..f4a337c5 100644
---- a/src/cats/update_sqlite3_tables.in
-+++ b/src/cats/update_sqlite3_tables.in
-@@ -13,13 +13,13 @@ echo " "
- 
- bindir=@SQLITE_BINDIR@
- PATH="$bindir:$PATH"
--cd @working_dir@
-+#cd @working_dir@
- db_name=@db_name@
- 
--DBVERSION=`sqlite3 ${db_name}.db <<END
--SELECT VersionId FROM Version LIMIT 1;
--END
--`
-+#DBVERSION=`sqlite3 ${db_name}.db <<END
-+#SELECT VersionId FROM Version LIMIT 1;
-+#END
-+#`
- if [ "$DBVERSION" -ne $OLDVERSION ] ; then
-   if [ "$DBVERSION" -lt 12 -o "$DBVERSION" -gt $NEWVERSION ] ; then
-     echo " "
diff --git a/src/cats/update_mysql_tables.in b/src/cats/update_mysql_tables.in
index d4bb96da..2c249b4f 100644
--- a/src/cats/update_mysql_tables.in
+++ b/src/cats/update_mysql_tables.in
@@ -32,8 +32,9 @@ ARGS=$*
 
 getVersion()
 {
-    mysql $ARGS -D ${db_name} -e "select VersionId from Version LIMIT 1\G" >/tmp/$$
-    DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$`
+    if test -f $OUTFILE; then
+	DBVERSION=`grep "UPDATE Version SET VersionId" $OUTFILE | tail -n 1 | sed 's/^[^0-9]*\([0-9][0-9]*\)[^0-9]*;/\1/'`
+    fi
 }
 
 getVersion
diff --git a/src/cats/update_postgresql_tables.in b/src/cats/update_postgresql_tables.in
index 9b808305..70d8548b 100644
--- a/src/cats/update_postgresql_tables.in
+++ b/src/cats/update_postgresql_tables.in
@@ -34,7 +34,9 @@ ARGS=$*
 
 getVersion()
 {
-    DBVERSION=`psql -d ${db_name} -t --pset format=unaligned -c "select VersionId from Version LIMIT 1" $ARGS`
+    if test -f $OUTFILE; then
+	DBVERSION=`grep -i "UPDATE Version SET VersionId" $OUTFILE | tail -n 1 | sed 's/^[^0-9]*\([0-9][0-9]*\)[^0-9]*;/\1/'`
+    fi
 }
 
 getVersion
@@ -161,100 +163,7 @@ if [ "$DBVERSION" -eq 15 -o "$DBVERSION" -eq 16 ]; then
     if [ "$DBVERSION" -eq 16 ]; then
         SKIP1018=1
     fi
-
-    # Can be adjusted
-    WORKMEM=1GB
-
-    COMP=`which pigz`
-    if [ "$COMP" = "" ]; then
-	COMP=`which pbzip2`
-	if [ "$COMP" = "" ]; then
-	    COMP=`which lzop`
-	    if [ "$COMP" = "" ]; then
-		COMP=`which gzip`
-		if [ "$COMP" = "" ]; then
-		    echo "Error. Cannot find pigz, pbzip2, lzop or gzip"
-		    exit 1
-		fi
-	    fi
-	fi
-    fi
-
-    echo "Dumping File table to $PWD/file1017.data. "
-    echo ""
-    echo "The process may fail if the current user"
-    echo " doesn't have write permission on the current directory,"
-    echo " or if the system doesn't have enough space to store a"
-    echo " compressed export of the File table"
-    psql --set ON_ERROR_STOP=1 -d ${db_name} $* -c "set work_mem='$WORKMEM';"'set enable_mergejoin to off ; set enable_hashjoin to off; copy (SELECT FileId, FileIndex, JobId, PathId, Filename.Name, DeltaSeq, MarkId, LStat, Md5 FROM File JOIN Filename USING (FilenameId)) TO STDOUT' | $COMP -1 -c > file1017.data
-    
-    if [ $? -ne 0 ]; then
-	echo "Error while dumping file table to $PWD/file1017.data"
-	exit 1
-    fi
-
-    if ! psql --set ON_ERROR_STOP=1 -f - -d ${db_name} $* <<EOF
-BEGIN;
-
-DROP TABLE File;
-DROP TABLE Filename;
-
-CREATE TABLE File
-(
-    FileId	      bigint	  not null,
-    FileIndex	      integer	  not null  default 0,
-    JobId	      integer	  not null,
-    PathId	      integer	  not null,
-    Filename	      text	  not null  default '',
-    DeltaSeq	      smallint	  not null  default 0,
-    MarkId	      integer	  not null  default 0,
-    LStat	      text	  not null,
-    Md5 	      text	  not null
-);
-
-COMMIT;
-EOF
-    then 
-	echo "Creation of new File table failed."
-	exit 1
-    fi
-
-    echo "Loading the File table from $PWD/file.$$.data..."
-    # we do everything in the same commit to avoid creating WALs on this operation
-    cat file1017.data | $COMP -d | psql --set ON_ERROR_STOP=1 -d ${db_name} $* -c "BEGIN; TRUNCATE File; COPY File FROM STDIN; set maintenance_work_mem='2000MB'; CREATE INDEX file_jpfid_idx on File (JobId, PathId, Filename text_pattern_ops); ALTER TABLE ONLY File ADD CONSTRAINT file_pkey PRIMARY KEY (FileId); COMMIT;"
-    
-    if [ $? -ne 0 ]; then
-	echo "Inserting File data from file.$$.data failed."
-	exit 1
-    fi
-
-    echo "Creation of indexes and PK on the File table..."
-
-    # The maximum value for maintenance_work_mem is 2GB
-    if ! psql --set ON_ERROR_STOP=1 -f - -d ${db_name} $* <<EOF
-set maintenance_work_mem='2000MB';
-BEGIN;
-CREATE SEQUENCE file_fileid_seq;
-ALTER SEQUENCE file_fileid_seq OWNED BY File.fileid;
-SELECT pg_catalog.setval('file_fileid_seq', (SELECT MAX(FileId) FROM File), true);
-ALTER TABLE File ALTER COLUMN FileId SET DEFAULT nextval('file_fileid_seq'::regclass);
-
-ANALYZE File;
-
-ALTER TABLE Media ALTER VolWrites TYPE BIGINT;
-ALTER TABLE unsavedfiles DROP COLUMN filenameid;
-ALTER TABLE unsavedfiles ADD COLUMN filename text not null;
-
-UPDATE Version SET VersionId = 1017;
-
-COMMIT;
-EOF
-    then
-	echo "Index creation for Bacula PostgreSQL tables."
-	exit 1
-    fi
     echo "Upgrade of the File table succeeded. Version 1017"
-    rm -f file1017.data
     getVersion
 fi
 
diff --git a/src/cats/update_sqlite3_tables.in b/src/cats/update_sqlite3_tables.in
index 4aaa5be1..7db63623 100644
--- a/src/cats/update_sqlite3_tables.in
+++ b/src/cats/update_sqlite3_tables.in
@@ -15,13 +15,13 @@ echo " "
 
 bindir=@SQLITE_BINDIR@
 PATH="$bindir:$PATH"
-cd @working_dir@
+#cd @working_dir@
 db_name=@db_name@
 
-DBVERSION=`sqlite3 ${db_name}.db <<END
-SELECT VersionId FROM Version LIMIT 1;
-END
-`
+#DBVERSION=`sqlite3 ${db_name}.db <<END
+#SELECT VersionId FROM Version LIMIT 1;
+#END
+#`
 if [ "$DBVERSION" -ne $OLDVERSION ] ; then
   if [ "$DBVERSION" -lt 12 -o "$DBVERSION" -gt $NEWVERSION ] ; then
     echo " "
