Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Here is what I runt into, trying to upgrade my drupal 6 to Drupal 7 after correctly having upgraded core and all modules to a supported version:
DatabaseSchemaObjectExistsException: Cannot add index <em class="placeholder">system_list</em> to table <em class="placeholder">system</em>: index already exists. in DatabaseSchema_mysql->addIndex() (line 424 of F:\xampp-2\htdocs\Jobs\rufzeichen-neu\includes\database\mysql\schema.inc).
I have CCK, Imagefield, Imagecache and more CCK stuff installed on the D6 site, but as far as I can tell from the message, this appears to be affecting only non-CCK-stuff.
If this issue is to be raised to critical lies to the judgement of others, basically I would raise any upgrade path issue to critical.
Still might be that I did something wrong before the attemt to upgrade.
Comments
Comment #1
eigentor CreditAttribution: eigentor commentedTo be precise: The upgrade cannot be performed, there is this message and it goes no further.
Comment #2
dwwI know it's confusing, but "update.module" is for the part of core (added in 6.x) that checks for available updates to your modules and themes. You're talking about update.php for DB updates, which is the "update system" component...
I don't think this should be critical until someone else can reproduce it, but it's major enough to seriously consider before 7.0. Can you provide more steps on how to trigger this? A partial and/or scrubbed DB dump that demos it in action?
Comment #3
eigentor CreditAttribution: eigentor commentedI may have made a stupid error. Is it that you need to disable all optional core modules before upgrade, like it was in upgrade Drupal 5 -> 6?
Comment #4
carlos8f CreditAttribution: carlos8f commentedI'm fairly certain that this system_list index error is not an issue in itself -- what has happened is that update_fix_d7_requirements() ran into a fatal error, never managed to variable_set('update_d7_requirements', TRUE), and the system_list error is the result of update_fix_d7_requirements() being called again after some changes have already been made. At this point, the upgrade is corrupted and you must revert back to your clean D6 backup and try again.
To prevent confusion, we might be able to variable_set('update_d7_requirements', -1) when we start the function, and check for that in update_prepare_d7_bootstrap() so we can set a requirements error and let them know the upgrade failed and to read UPGRADE.txt, etc. and try again.
@eigentor, in theory there should've been an error message before you started getting the system_list error. Could you try again from scratch and see about that?
Comment #5
eigentor CreditAttribution: eigentor commentedO.K. I tried it another time from scratch. The first time I disabled all contrib modules with a drush script. Now I did it manually, one by one, and the upgrade worked! Also I used Head instead of beta 1 of D7 So marking this fixed, moving on to other issues with the upgrade.
Comment #6
dwwGreat, glad to hear it. Thanks.
Comment #8
zxs CreditAttribution: zxs commentedThe same issue. I can't upgrade drupal 6.19 to drupal 7 beta2 or -dev.
I disabled all modules (except Core and Core - optional) and when upgrade starts, I get this error:
When I try again, I get another error:
Comment #9
carlos8f CreditAttribution: carlos8f commented@zxs, see #934634: Upgrading a Pressflow site fails because cache_path table already exists.. Applying the patch there should get you a successful upgrade.
Comment #11
Valeratal CreditAttribution: Valeratal commentedI have this problem
DatabaseSchemaObjectExistsException: Cannot add index system_list to table system: index already exists. in DatabaseSchema_mysql->addIndex() (line 433 of /site/includes/database/mysql/schema.inc).
P.S. I disabled all contrib modules, and cheked in table system (phpmyadmin)
Comment #12
rfayComment #13
PsySal CreditAttribution: PsySal commentedI encountered this in upgrading from DP6 to DP7. It occurs in update.php when trying to take the (normally correct) upgrade path from DP6 to DP7.
I think the cause may have been that I first tried to upgrade directly from DP5 to DP7, maybe messing up some tables in the meantime, but here is what solved it:
You need to perform all three actions at once, using your favorite database editor (e.g., phpMyAdmin.) Then, run update.php again and it should go through.
If you get more error messages about fields or indexes not being able to be created, just make a note of which ones, and try again. Remember to remove them all at once before trying to run update.php again.
If you only fix one at a time, you will just end up hitting the earlier error, somehow the update script wants to upgrade a number of fields and indices all at once and doesn't consider if that operation previously only partially completed (e.g., when you failed during an upgrade from DP5 to DP7.)
Hopefully this is helpful to somebody.
Comment #14
philsward CreditAttribution: philsward commentedIn my case, from what I can tell, I accidentally uninstalled "update status", mistaking it for "upgrade status" (which doesn't have an uninstall option...)
Comment #15
madhusudan CreditAttribution: madhusudan commented@PsySal
same case here.. really a weird problem!. had to remove some more fields..
why there is no "DROP TABLE IF EXISTS" feature in drupal 7?
Comment #16
j9 CreditAttribution: j9 commentedHi, I have the same error on upgrading from drupal 6.26 to drupal 7.14:
DatabaseSchemaObjectExistsException: Cannot add index <em class="placeholder">system_list</em> to table <em class="placeholder">system</em>: index already exists. in DatabaseSchema_mysql->addIndex() (line 437 of /var/www/vhosts/fly7/includes/database/mysql/schema.inc).
I do not know what this means from the instructions above:
I searched w/ phpmyadmin for system_list but could not find anything.
Thanks!
Comment #17
madhusudan CreditAttribution: madhusudan commented@j9
follow PsySal suggestion (#13 post), your problem will be solved..
system_list is in "system" table, its not field its an index..
give this in phpmyadmin to remove index
drop index system_list on system;
Comment #18
Michsk CreditAttribution: Michsk commentedThe drops and alters i had to do:
Comment #19
madhusudan CreditAttribution: madhusudan commentedsince system_list is a core part , all the core DB updates should happen automatically without error(no matter how many times you run update script) , and this still exists in the current stable 7.14 version,
I am marking this as a bug.
Comment #20
catchYou can only run update.php once - if you get failures, you need to restart the upgrade process from the beginning (for this reason you should make a backup of your site, and upgrade the backup then switch it over when it's completed successfully).
Comment #21
j9 CreditAttribution: j9 commented@madhusudan and lasac -- sweet thanks! much appreciated!
Comment #22
rv0 CreditAttribution: rv0 commenteddrops and alters i needed to get it going:
drop index system_list on system;
alter table url_alias drop column alias;
alter table url_alias drop column source;
alter table menu_router drop column context;
alter table menu_router drop column delivery_callback;
alter table menu_router drop column theme_callback;
alter table menu_router drop column theme_arguments;
drop table role_permission;
drop table date_format_type;
I didn't do update.php before.
Comment #23
SeanA CreditAttribution: SeanA commentedSame problem, same solution as #22.
Comment #24
hyperlinked CreditAttribution: hyperlinked commentedI also had this problem and the solution as it was in other cases was to simply drop any index or field that was throwing the error. The tricky part is that you may have to drop multiple fields and multiple indices as people above have had to do, but each time you run the updater, it re-creates those same indices and fields that you needed to drop in the first place. So where this gets frustrating, is that each time you find a new error that prevents your upgrade from succeeding, you have to backtrack and repeat every single step that you already applied, plus a new one to remove the new obstacle that you discovered.
To save you time, maybe you should just try the drops that are in # 22, but it's possible that even that solution leaves out some potential problem fields that are in your installation, but not other peoples.
Comment #25
wadley0 CreditAttribution: wadley0 commentedPoint of clarification:
The problem is caused by the extra tables that are created during the upgrade process. There are essentially two solutions...
Just in case anyone experiences the same trouble I had:
Rolling back the database is only an option if it is "clean"...
...it wasn't working for me, and I couldn't figure out why. It turns out, that I had attempted to upgrade at some prior date without rolling back the database at that time. The extra tables that had been created had no adverse effect on the d6 installation, so I had forgotten the previous attempt to upgrade. So when it came time to attempt an upgrade again, rolling back the database was no longer an option because the database I was using already had the extra table in it... the only remaining option was the alternate solution of removing the extra tables manually. I took the advice in #24, and started with the drops in #22, which worked fine for me.
Comment #26
nattsExtending from #22, I had to use these queries:
Relating to that last query with the sessions table, mine had nearly 16M rows, so truncating it helped also.
Comment #27
asb CreditAttribution: asb as a volunteer commentedWasted a whole day, trying to prepare a D6 site for a upgrade to D7. Ran
./update.php
once, immediately was hit by crude error messages like the following, all on the same page:1)
2)
3)
Multiple errors at once? Which one ist it that kills
./update.php
, no. 2 or no. 3? Does it really help to "try again later"?Tried suggestions from #18, then #22 and finally #26. None of these allowed me to proceed with the Drupal core upgrade which is important, everybody keeps telling me.
Especially interesting is my last attempt (#26), which started with:
DROP <strong>INDEX system_list</strong> ON system;
And resulted in this error:
DatabaseSchemaObjectExistsException: Cannot add <strong>index system_list</strong> to table system: index already exists. in DatabaseSchema_mysql->addIndex() (line 445 of /var/www/{mysite}/includes/database/mysql/schema.inc).
If
./update.php
recreates this table and then dies because of the table it just created, I'd consider this a BUG!If this is "normal behaviour" for Drupal, just shoot me dead.
However, this nonsense makes it impossible to upgrade from Drupal 6 - which is EOL - to the next supported major release.
Comment #29
stephencamilo CreditAttribution: stephencamilo as a volunteer commentedComment #30
hestenetReset issue status.