I'm trying to upgrade from CiviCRM 4.7.4 to 4.7.9 for its security update. I'm doing this using 'drush' on my dev site. It seems to be hitting a couple different problems. Here's the first step:
% drush --version
Drush Version : 8.1.2
% drush -vv cvup --tarfile=~/Downloads/civicrm-4.7.9-drupal.tar.gz
Executing: mysql --defaults-extra-file=/private/var/tmp/drush_I5s0Cd --database=singersin_drupal --host=localhost --silent < /private/var/tmp/drush_yqQTCt
Executing: mysql --defaults-extra-file=/private/var/tmp/drush_Sw9qa5 --database=singersin_drupal --host=localhost --silent < /private/var/tmp/drush_X3IP5L
The upgrade process involves -
1. Backing up current CiviCRM code as => /Users/ken/Documents/SIA/server275-site/../backup/modules/20160712223432/civicrm
2. Backing up database as => /Users/ken/Documents/SIA/server275-site/../backup/modules/20160712223432/civicrm.sql
3. Unpacking tarfile to => /Users/ken/Documents/SIA/server275-site/sites/all/modules/
4. Executing civicrm/upgrade?reset=1 just as a browser would.
Do you really want to continue? (y/n): y
[ok]
1. Code backed up.
Executing: mysql --defaults-extra-file=/private/var/tmp/drush_wbODsK --database=singersin_drupal --host=localhost --silent < /private/var/tmp/drush_oyC1qd
Calling system(mysqldump --defaults-extra-file=/private/var/tmp/drush_UDJ4q2 singersin_drupal --host=localhost --no-autocommit --single-transaction --opt -Q > /Users/ken/Documents/SIA/server275-site/../backup/modules/20160712223432/civicrm.sql);
Database dump saved to /Users/ken/Documents/SIA/server275-site/../backup/modules/20160712223432/civicrm.sql [success]
2. Database backed up. [ok]
Undefined variable: tarfile civicrm.drush.inc:368 [notice]
Executing: gzip -d
Executing: tar -xf /Users/ken/Downloads/civicrm-4.7.9-drupal.tar.gz -C "/Users/ken/Documents/SIA/server275-site/sites/all/modules/"
3. Tarfile unpacked. [ok]
4. [notice]
You are already upgraded to CiviCRM 4.7.4
[completed]
Process completed.
Command dispatch complete [notice]
First, notice the "Undefined variable: tarfile" in the output. I think that's because of this code in civicrm.drush.inc
:
function _civicrm_extract_tarfile($destinationPath, $option = 'tarfile') {
$tarpath = drush_get_option($option, FALSE);
if (drush_shell_exec("gzip -d " . $tarfile)) {
$tarpath = substr($tarfile, 0, strlen($tarfile) - 3);
}
drush_shell_exec("tar -xf $tarpath -C \"$destinationPath\"");
}
There are 3 instances of $tarfile
that should be $tarpath
, right?
The next problem is that it can't recognize the version it's trying to upgrade to - it says "You are already upgraded to CiviCRM 4.7.4", when trying to upgrade to 4.7.9. I'm guessing that's because the code was originally loaded when 4.7.4 was installed, so it would need to re-load itself somehow to detect that it's out of date.
Okay, no problem, I figured I could just run drush cvupdb
separately. However, this fails with a database error:
% drush cvupdb
PEAR_Exception: "DB Error: unknown error"
* ERROR TYPE: DB_Error
* ERROR CODE: -1
* ERROR MESSAGE: DB Error: unknown error
* ERROR MODE: 16
* ERROR USERINFO: ALTER TABLE `civicrm_contact` CHANGE `image_URL` `image_URL` VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT
'optional URL for preferred image (photo, logo, etc.) to display for this contact.'
[nativecode=1071 ** Specified key was too long; max key length is 767 bytes]
* ERROR DEBUGINFO: ALTER TABLE `civicrm_contact` CHANGE `image_URL` `image_URL` VARCHAR(512) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL COMMENT
'optional URL for preferred image (photo, logo, etc.) to display for this contact.'
[nativecode=1071 ** Specified key was too long; max key length is 767 bytes]
...
My database is MySQL version 5.6.27, is that problematic? What's a next step?
Thanks.