Just ran into the following database error while upgrading from Assets 1.2.2 to 2.0.1. I'm running EE 2.5.1

A Database Error Occurred
Error Number: 1050

Table 'exp_assets_folders' already exists

CREATE TABLE `exp_assets_folders` ( `folder_id` int(10) UNSIGNED AUTO_INCREMENT, `source_type` varchar(2) DEFAULT 'ee' NOT NULL, `folder_name` varchar(255) NOT NULL, `full_path` varchar(255), `parent_id` int(10) UNSIGNED NULL, `source_id` int(10) UNSIGNED, `filedir_id` int(4) UNSIGNED, PRIMARY KEY `folder_id` (`folder_id`) ) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

Filename: third_party/assets/upd.assets.php

Line Number: 430

I made sure the extension was enabled, then went to run module updates, confirmed DB was backed up and encountered this error.

  • So this is odd. I checked my source database before running the Assets 2 updated and the exp_assets_folders table (along with the new assets 2 folder) do not exist. After reimporting this database over the botched update, I double check to make sure the tables aren't there—but they are? How is this possible?
    – Jon Horton
    Jan 17 '13 at 0:01
  • They must exist in the sql file you're trying to re-import from. Are you sure you made that backup before the first botched update?
    – Brad Bell
    Jan 17 '13 at 0:09
  • Positive. I exported a brand new db from our live site just to make sure. I think, perhaps, the import does not drop all tables in the local db, only ones that exist in the SQL file being imported. (This would make sense since I tested Assets beta a few months ago, but reverted to a DB backup)
    – Jon Horton
    Jan 17 '13 at 0:12
  • Just dropped all tables manually, reimported my backup and the Assets 2 tables are now gone. While this resolves the initial error, I now receive a ton of undefined index PHP errors on running module updates.
    – Jon Horton
    Jan 17 '13 at 0:21
  • Right - running the backup file without dropping all of the existing tables won't delete any tables that were newly created. Maybe make a new SE post with the new problem?
    – Brad Bell
    Jan 17 '13 at 0:24

I had previously attempted to try out the Assets 2 Beta, but upon receiving some PHP errors and not having time to test it out thoroughly, I restored a database backup.

This backup however, wasn't set to drop all tables in the database—only ones that were being imported.

After manually removing all tables and reimporting my database backup, I no longer received the database error when running the module updates.

Not the answer you're looking for? Browse other questions tagged or ask your own question.