User login

Problems upgrading a Drupal site with Webform from 6.x to 7.x (Webform in 7 does not upgrade to 3.x from 2.x)

Short version: Upgrade webform to 3.x first, while still on your Drupal 6 site.

Went back to the database that i swear i dumped right after upgrading. And the system table has version 7.0 core modules in it, so it's not like i accidentally

ben@ubuntu:~/code/anjali7/web$ drush updatedb
WD php: DatabaseSchemaObjectExistsException: Table role_permission already exists. in DatabaseSchema->createTable() (line 630 of [error]
/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. [error]
ben@ubuntu:~/code/anjali7/web$ drush status
...
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Call to undefined function decode_entities() in /home/ben/workspace/drush/includes/drush.inc, line 2449

Fatal error: Call to undefined function decode_entities() in /home/ben/workspace/drush/includes/drush.inc on line 2449

Call Stack:
0.0016 393292 1. {main}() /home/ben/workspace/drush/drush.php:0
0.0253 2214100 2. drush_main() /home/ben/workspace/drush/drush.php:42
0.1006 5083700 3. drush_bootstrap_to_phase() /home/ben/workspace/drush/drush.php:91
0.1006 5083700 4. drush_bootstrap_max() /home/ben/workspace/drush/includes/environment.inc:294
0.1833 6985500 5. drush_bootstrap() /home/ben/workspace/drush/includes/environment.inc:344
0.1834 6986424 6. _drush_bootstrap_drupal_full() /home/ben/workspace/drush/includes/environment.inc:195
0.1834 7027504 7. drupal_bootstrap() /home/ben/workspace/drush/includes/environment.inc:957
0.2313 8328800 8. drupal_session_initialize() /home/ben/code/anjali7/web/includes/bootstrap.inc:2043
0.2368 8330756 9. date_default_timezone_set() /home/ben/code/anjali7/web/includes/session.inc:262
0.2369 8331788 10. _drupal_error_handler() /home/ben/code/anjali7/web/includes/bootstrap.inc:0
0.2379 8396532 11. _drupal_error_handler_real() /home/ben/code/anjali7/web/includes/bootstrap.inc:2095
0.2551 9688340 12. _drupal_log_error() /home/ben/code/anjali7/web/includes/errors.inc:87
0.2551 9688652 13. watchdog() /home/ben/code/anjali7/web/includes/errors.inc:213
0.2566 9692572 14. module_invoke() /home/ben/code/anjali7/web/includes/bootstrap.inc:1630
0.2566 9693952 15. call_user_func_array() /home/ben/code/anjali7/web/includes/module.inc:793
0.2566 9694204 16. system_watchdog() /home/ben/code/anjali7/web/includes/module.inc:0

And going to any page on the site:

Uncaught exception thrown in session handler.

PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ssid' in 'where clause': SELECT 1 AS expression FROM {sessions} sessions WHERE ( (sid = :db_condition_placeholder_0) AND (ssid = :db_condition_placeholder_1) ) FOR UPDATE; Array ( [:db_condition_placeholder_0] => _lzsWEtXuX4eV5zGZbEfuihDSMWVub7hgaPtrtpatVU [:db_condition_placeholder_1] => ) in _drupal_session_write() (line 204 of /home/ben/code/anjali7/web/includes/session.inc).

Different errors after every upgrade? precious. [to be fair, this one is only an error for cache clear all. Another tidbit? Clearing each cache individually works, 2-9 in Drush. The all cache (1) fails, with the below messages:

ben@ubuntu:~/code/anjali7/web$ drush cc all
WD actions: 2 orphaned actions (simplenews_cron_action, user_block_ip_action) exist in the actions table. Remove orphaned actions [warning]
WD php: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'w.block' in 'where clause': SELECT w.*, n.title AS title [error]
FROM
{webform} w
LEFT OUTER JOIN {node} n ON w.nid = n.nid
WHERE (w.block = :db_condition_placeholder_0) AND (n.type IN (:db_condition_placeholder_1)) ; Array
(
[:db_condition_placeholder_0] => 1
[:db_condition_placeholder_1] => webform
)
in webform_block_info() (line 1423 of /home/ben/code/anjali7/web/sites/all/modules/contrib/webform/webform.module).
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'w.block' in 'where clause': SELECT w.*, n.title AS title
FROM
{webform} w
LEFT OUTER JOIN {node} n ON w.nid = n.nid
WHERE (w.block = :db_condition_placeholder_0) AND (n.type IN (:db_condition_placeholder_1)) ; Array
(
[:db_condition_placeholder_0] => 1
[:db_condition_placeholder_1] => webform
)
in webform_block_info() (line 1423 of /home/ben/code/anjali7/web/sites/all/modules/contrib/webform/webform.module).
Drush command terminated abnormally due to an unrecoverable error. [error]

The problem is that Webform will not upgrade from 6.x-2.x to 7.x-3.x. My problem is that i don't want to mess with doing an upgrade on the 6.x site. So i'll have to steal all the queries from the latest 6.x-3.x that upgrade it from 2.x, and run them.

Looking in the 6.x-2.10 webform we have installed, we can see that the last update hook in webform.install is webform_update_6205().

HAHAHAHAHA! No, you cannot take Drupal 6 update hooks and even think about running them in Drupal 7.

Alternate approach: hook/hack into Drush in its upgrade prepare step and run the D6 2.x to 3.x upgrade there.
Approach taken: Just upgrade to 3.x for the live site. It was painless and webform block, although officially obsolete, continued to work fine (disabling webform_block module made the block disappear, so the now-native webform block capability in webform will have to be configured for Drupal 7).

Turns out webform 3.x upgrades flawlessly and without any noticable differences in our contact webform or the webform listing pages, so we will upgrade this module on the D6 site, and take that change live, to form the basis of the coming upgrade.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or "class="OPTIONS" title="the title".
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.