Index: main/trunk/greenstone2/perllib/DBDrivers/BaseDBDriver.pm
===================================================================
--- main/trunk/greenstone2/perllib/DBDrivers/BaseDBDriver.pm	(revision 31187)
+++ main/trunk/greenstone2/perllib/DBDrivers/BaseDBDriver.pm	(revision 31188)
@@ -344,4 +344,31 @@
 
 
+## @function rename_db_file_to(string, string) => void
+#
+sub rename_db_file_to {
+    my $self = shift(@_);
+    my ($srcpath, $destpath) = @_;
+
+    # rename basic db file
+    &FileUtils::moveFiles($srcpath, $destpath);
+
+    # subclass should rename any additional files that the specific dbtype creates
+}
+## rename_db_file_to(string, string) => void ##
+
+## @function remove_db_file(string) => void
+#
+sub remove_db_file {
+    my $self = shift(@_);
+    my ($db_filepath) = @_;
+    
+    # remove basic db file
+    &FileUtils::removeFiles($db_filepath);
+
+    # subclass must rename any additional files that the specific dbtype creates (e.g. transaction log files)
+}
+## remove_db_file(string, string) => void ##
+
+
 ## @function supportsDatestamp(void) => integer
 #
Index: main/trunk/greenstone2/perllib/DBDrivers/GDBM.pm
===================================================================
--- main/trunk/greenstone2/perllib/DBDrivers/GDBM.pm	(revision 31187)
+++ main/trunk/greenstone2/perllib/DBDrivers/GDBM.pm	(revision 31188)
@@ -70,4 +70,6 @@
 # Handled by BaseDBDriver
 # sub get_infodb_file_path(string, string) => string
+# sub rename_db_file_to(string, string) => void
+# sub remove_db_file(string) => void
 
 # Handled by 70HyphenFormat
Index: main/trunk/greenstone2/perllib/DBDrivers/JDBM.pm
===================================================================
--- main/trunk/greenstone2/perllib/DBDrivers/JDBM.pm	(revision 31187)
+++ main/trunk/greenstone2/perllib/DBDrivers/JDBM.pm	(revision 31188)
@@ -83,5 +83,5 @@
 # -----------------------------------------------------------------------------
 
-# When DBUtil::* is properly structured with inheritence, then
+# When DBUtil::* is properly structured with inheritance, then
 # much of this code (along with GDBM and GDBM-TXT-GZ) can be grouped into
 # a shared base class.  Really it is only the the command that needs to
@@ -91,5 +91,5 @@
 # sub get_infodb_file_path {}
 
-# Handles by 70HyphenFormat
+# Handled by 70HyphenFormat
 # sub open_infodb_write_handle(string, string?) => filehandle
 # sub close_infodb_write_handle(filehandle) => void
Index: main/trunk/greenstone2/perllib/dbutil.pm
===================================================================
--- main/trunk/greenstone2/perllib/dbutil.pm	(revision 31187)
+++ main/trunk/greenstone2/perllib/dbutil.pm	(revision 31188)
@@ -564,3 +564,21 @@
 ## write_infodb_rawentry(string, *) => void ##
 
+## @function rename_db_file_to(string, string) => void
+#
+sub rename_db_file_to {
+    my $infodb_type = shift(@_);
+    my $driver = _loadDBDriver($infodb_type);
+    $driver->rename_db_file_to(@_);    
+}
+## rename_db_file_to(string, string) => void ##
+
+## @function remove_db_file(string) => void
+#
+sub remove_db_file {
+    my $infodb_type = shift(@_);
+    my $driver = _loadDBDriver($infodb_type);
+    $driver->remove_db_file(@_);    
+}
+## remove_db_file(string, string) => void ##
+
 1;
Index: main/trunk/greenstone2/perllib/dbutil/jdbm.pm
===================================================================
--- main/trunk/greenstone2/perllib/dbutil/jdbm.pm	(revision 31187)
+++ main/trunk/greenstone2/perllib/dbutil/jdbm.pm	(revision 31188)
@@ -306,5 +306,4 @@
 
 
-
 sub delete_infodb_entry
 {
@@ -320,6 +319,40 @@
 
 
-
-
+# jdb also creates .lg log files, that don't get removed on delete or move operations
+# Make sure to rename them to when performing a rename operation on the main db file.
+# dbutil::renameTo(src,dest) already took care of renaming the main db file.
+sub rename_db_file_to {
+    my $infodb_handle = shift(@_);
+    my ($srcpath, $destpath) = @_;
+
+    my ($srctailname, $srcdirname, $srcsuffix)
+	= &File::Basename::fileparse($srcpath, "\\.[^\\.]+\$");
+    my ($desttailname, $destdirname, $destsuffix)
+	= &File::Basename::fileparse($destpath, "\\.[^\\.]+\$");
+
+    # add in the lg extension
+    my $src_log_file = &FileUtils::filenameConcatenate($srcdirname, $srctailname.".lg");
+    my $dest_log_file = &FileUtils::filenameConcatenate($destdirname, $desttailname.".lg");
+
+    # finally, move/rename any log file belonging to the src db file
+    if(&FileUtils::fileExists($src_log_file)) {
+	&FileUtils::moveFiles($src_log_file, $dest_log_file);
+    }
+}
+
+sub remove_db_file {
+    my $infodb_handle = shift(@_);
+    my ($db_filepath) = @_;
+
+    # add in the lg extension to get the log file name
+    my ($tailname, $dirname, $suffix) = &File::Basename::fileparse($db_filepath, "\\.[^\\.]+\$");
+    my $assoc_log_file = &FileUtils::filenameConcatenate($dirname, $tailname.".lg");
+
+    # remove any log file associated with the db file
+    if(&FileUtils::fileExists($assoc_log_file)) {
+	&FileUtils::removeFiles($assoc_log_file);
+    }
+
+}
 
 1;
