diff --git a/includes/destinations.db.inc b/includes/destinations.db.inc
index bb619c2..bfb425a 100644
--- a/includes/destinations.db.inc
+++ b/includes/destinations.db.inc
@@ -141,13 +141,12 @@ class backup_migrate_destination_db extends backup_migrate_destination_remote {
    */
   function backup_to_file($file, $settings) {
     $file->push_type($this->get_file_type_id());
+    // Switch to a different db if specified.
     $this->switch_db();
 
     backup_migrate_filters_invoke_all('pre_backup', $this, $file, $settings);
     $this->lock_tables($settings);
 
-    // Switch to a different db if specified.
-    $this->switch_db();
     $success = $this->_backup_db_to_file($file, $settings);
     // Switch back to the previous db.
     $this->switch_db(TRUE);
