I'm trying to update from 6.19 to 7.x.dev (I've tried also with 7 RC2).

I'm getting following errors:

DatabaseSchemaObjectExistsException: Cannot add field url_alias.source: field already exists. in DatabaseSchema_mysql->addField() (line 324 of /var/www/zona7/includes/database/mysql/schema.inc).

DatabaseSchemaObjectExistsException: Cannot add field menu_router.delivery_callback: field already exists. in DatabaseSchema_mysql->addField() (line 324 of /var/www/zona7/includes/database/mysql/schema.inc). Database: menu_router

DatabaseSchemaObjectExistsException: Cannot add index system_list to table system: index already exists. in DatabaseSchema_mysql->addIndex() (line 433 of /var/www/zona7/includes/database/mysql/schema.inc).

DatabaseSchemaObjectExistsException: Table role_permission already exists. in DatabaseSchema->createTable() (line 623 of /var/www/zona7/includes/database/schema.inc).

I'm getting only one error at a time, not all at the same try. I've checked the original 6.19 database and the fields and indexes that the installer is trying to create do not exist in the original database, so my guess is that the installer creates them first, and then checks if they already exists.

I've disabled all optional (core and custom) modules on the 6.19 database, before trying to update.

Thanks!

Comments

federico’s picture

Ok, I found that you have to enable PDO to proceed with update to drupal 7 , I've enabled PDO by adding

extension=pdo.so 
extension=pdo_mysql.so

to php.ini but I'm still getting the errors (I'm not using PECL, I'm using Ubuntu)

This issue seems to be a duplicate of #982748: Database Errors trying to upgrade D6 site to D7 , feel free to mark this as duplicated, but I'm using latest dev version here.

catch’s picture

Component: update system » ajax system
Status: Active » Closed (duplicate)
bryancasler’s picture

#1 seemed to have helped

mlncn’s picture

darn you, Catch, and your recursive duplicate :-P

How could this work last week and not this week?

mysql> drop database anjali7;
Query OK, 233 rows affected (0.44 sec)

mysql> create database anjali7;
Query OK, 1 row affected (0.00 sec)

mysql> exit;
Bye
ben@ubuntu:~/code/anjali7/web$ `drush sql-connect` < ~/code/anjali/db/production.sql
ben@ubuntu:~/code/anjali7/web$ drush updatedb
WD php: DatabaseSchemaObjectExistsException: Table role_permission [error]
already exists. in DatabaseSchema->createTable() (line 630 of
/home/ben/code/anjali7/web/includes/database/schema.inc).
DatabaseSchemaObjectExistsException: Table role_permission already exists. in DatabaseSchema->createTable() (line 630 of /home/ben/code/anjali7/web/includes/database/schema.inc).
Drush command terminated abnormally due to an unrecoverable error.

thath’s picture

wuped’s picture

Was there ever a solution to this found? I am currently running into the same issue in updating and can't seem to get around it. Enabling pdo didn't change anything.

dwollen’s picture

I had to do this:

ALTER TABLE system DROP INDEX system_list;
ALTER TABLE `url_alias`
DROP `source`,
DROP `alias`;
ALTER TABLE `menu_router` DROP `context`;
ALTER TABLE `menu_router` DROP `delivery_callback`;
ALTER TABLE `menu_router` DROP `theme_callback`;
ALTER TABLE `menu_router` DROP `theme_arguments`;
DROP TABLE `role_permission`;
DROP TABLE `date_format_type`;
DROP TABLE `blocked_ips`;

before the upgrade D6 to D7 was able to run correctly.

Regards,
Denis Wollenhaupt

sunilkansodiya’s picture

If you are getting filed already exists when you are doing drush updb OR running update.php then just drop this field and run again.

I hope your problem will be resolve.