I've spent hundreds of hours trying to get an old D6 site upgraded to D7 and I keep encountering errors like the following:

Cannot add index system_list to table system: index already exists.
Cannot rename blocks to block: table block already exists. [error]
Cannot rename comments to comment: table comment already exists. [error]
Cannot rename filter_formats to filter_format: table filter_format already exists. [error]
Cannot rename filters to d6_upgrade_filter: table d6_upgrade_filter already exists
Cannot rename filters to d6_upgrade_filter: table filters doesn't exist
Cannot rename profile_fields to profile_field: table profile_field already exists. [error]
Cannot rename term_data to taxonomy_term_data: table taxonomy_term_data already exists. [error]
Duplicate entry 'modules/update/tests/aaa_update_test.module' for key 'PRIMARY': INSERT INTO {system} 
Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'garland-system-help' for key 'tmd': INSERT INTO {block} (module, delta, theme, status, weight, region, pages, cache) VALUES
Failed: PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.field_config_instance' doesn't exist: INSERT INTO {field_config_instance}
Fatal error: Call to undefined function field_read_fields() in /var/www/www.example.com/modules/field/modules/field_sql_storage/field_sql_storage.install on line 16
Integrity constraint violation: 1062 Duplicate entry 'modules/update/tests/aaa_update_test.module' for key 'PRIMARY': INSERT INTO {system}
Table blocked_ips already exists. [error]
Table date_format_type already exists.
Table field_config_instance already exists
Table filter already exists
Table forum_index already exists.
Table role_permission already exists

I realize this is probably several problems rolled into a single request but I am at my wit's end here. Somebody please help me.

Comments

jsit created an issue. See original summary.

jsit’s picture

If I run drush site-upgrade on my unmodified database, I get:

WD php: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'source' in 'field list': SELECT source FROM {url_alias} WHERE alias = :alias AND language IN (:language, :language_none) ORDER BY language ASC, pid[error]
DESC; Array
(
    [:alias] => node
    [:language] => en
    [:language_none] => und
)
 in drupal_lookup_path() (line 176 of /var/www/www.example.com/includes/path.inc).

But if I create the column source beforehand to try to prevent this error, I then get this:

WD php: DatabaseSchemaObjectExistsException: Cannot add field url_alias.source: field already exists. in DatabaseSchema_mysql->addField() (line 336 of /var/www/www.example.com/includes/database/mysql/schema.inc).

How am I supposed to get around this?

cilefen’s picture

Do the tables and indexes referenced in the errors exist in the Drupal 6 site database before beginning the update? If so that would be the obvious cause of most of these. Are you actually trying to report a bug?

Please note:

If you are posting support requests to the core issue queue, you may be better off posting to the forums, or asking in #drupal on irc. Sometimes support requests result from common misconceptions about Drupal (especially install and upgrade), or may turn out to be functional bugs. If there are actionable steps to fix them, they can be converted to bugs or tasks (for example a task in the documentation component).

https://www.drupal.org/core/issue-category#support

cilefen’s picture

#2 seems a Catch-22.

cilefen’s picture

Have you compared the database of this problem site with a clean D6 install with the same modules and some sample content?

jsit’s picture

Thanks so much cilefen for the advice. I haven't tried #5 but will today.

jsit’s picture

I've installed a clean D6 and ran drush site-upgrade and it worked just fine.

Oddly, in the upgraded D7 database, there still don't exist some of the tables and columns that the upgrade process complains about when I do it on my "real" site. For instance, the url_alias table still has columns named src and dst rather than source and alias, columns my broken upgrade process keeps getting stuck looking for.

jsit’s picture

Ok, I've managed to upgrade core by making changes to certain tables/columns based on the feedback from the Schema project, based on this comment.

https://www.drupal.org/node/1053684#comment-7295144

Amazing! Now I just need to get all contrib modules updated :S

Thanks cilefen!

Version: 7.56 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.