PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'danubech_d6.backup_migrate_destinations' doesn't exist: SELECT * FROM {backup_migrate_destinations}; Array ( ) in backup_migrate_item->all_items() (line 619 of /home1/danubech/public_html/sites/all/modules/backup_migrate/includes/crud.inc).

This is what I got after doing my D6.20>D7.0 upgrade and trying to backup the site.
I was able to uninstall backup_migrate, then enable it again to clear the problem.
Could this be because private files location had been undefined and got a new location?
Had not installed views yet, because instructions were to backup everything before doing module upgrades.

Comments

ronan’s picture

Status: Active » Closed (cannot reproduce)

No idea what could have happened here. That table isn't new int he d7 version so it must have gotten deleted in the update somehow. I'll close this since you've fixed your site and nobody else has reported this

jordiserra’s picture

I am having the same issue, I am upgrading 6.28 to 7.19.

Alan D.’s picture

Issue summary: View changes
Status: Closed (cannot reproduce) » Closed (duplicate)
Related issues: +#1199946: Disabled modules are broken beyond repair so the "disable" functionality needs to be removed

Yep totally sucks, this kills the menu table rebuild. Most likely due to the related error.

Quick fix.

Add a wrapper to that call in includes/crud.inc:

// The try { is new
try {
    // Get the items from the db.
    $result = db_query("SELECT * FROM {{$this->db_table}}", array(), array('fetch' => PDO::FETCH_ASSOC));
    foreach ($result as $info) {
      $info = $this->decode_db_row($info);
      if ($item = $this->create($info)) {
        $item->storage = empty($items[$item->get_id()]) ? BACKUP_MIGRATE_STORAGE_DB : BACKUP_MIGRATE_STORAGE_OVERRIDEN;
        $items[$item->get_id()] = $item;
      }
    }
// and so is this
catch (Exception $e) {}

Comment out this bit in backup_migrate.install


/**
  $schema['backup_migrate_destinations'] = array(
    'fields' => array(
       ... cut to save space ....
    'primary key' => array('destination_id'),
  );
*/

Disable, uninstall, reenable. Revert back to the original code.