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
Comment #2
jsit commentedIf I run
drush site-upgradeon my unmodified database, I get:But if I create the column
sourcebeforehand 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?
Comment #3
cilefen commentedDo 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:
—https://www.drupal.org/core/issue-category#support
Comment #4
cilefen commented#2 seems a Catch-22.
Comment #5
cilefen commentedHave you compared the database of this problem site with a clean D6 install with the same modules and some sample content?
Comment #6
jsit commentedThanks so much cilefen for the advice. I haven't tried #5 but will today.
Comment #7
jsit commentedI'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.
Comment #8
jsit commentedOk, 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!