When following the procedure in Drupal core's UPGRADE.txt, and upgrading from the recommended release of uuid, 6.x-beta2, dated 2010-Sep-08, the upgrade fails when updatedb attempts to run the update uuid_6004. Starting the upgrade over, and fist advancing uuid to version uuid-6.x-dev, dated 2012-Feb-14 (effectively running update 6004 and 6005 on Drupal 6 prior to the Drupal 7 upgrade), then the upgrade succeeds.

Generally, users are expected to update contrib modules to the latest stable release prior to upgrade. Pushing out a Beta-3 release would make the upgrade process much smoother and more obvious for uuid users.

c.f. #1149546: Please release 6.x-beta3, as it is not possible to upgrade to Drupal-7.x if uuid-6.x-beta2 is installed

Comments

greg.1.anderson’s picture

Category: task » support

I spoke too soon; although the procedure I described above did allow the updatedb to work, I am still having the problems with missing uuid columns described here: http://drupal.org/node/1255550

I could get the site back to a working state by doing this:

ALTER TABLE  `node_revision` ADD  `vuuid` VARCHAR( 36 ) NOT NULL DEFAULT  '' COMMENT  'The Universally Unique Identifier.';
ALTER TABLE  `node` ADD  `uuid` VARCHAR( 36 ) NOT NULL DEFAULT  '' COMMENT  'The Universally Unique Identifier.';
ALTER TABLE  `file_managed` ADD  `uuid` VARCHAR( 36 ) NOT NULL DEFAULT  '' COMMENT  'The Universally Unique Identifier.';
ALTER TABLE  `users` ADD  `uuid` VARCHAR( 36 ) NOT NULL DEFAULT  '' COMMENT  'The Universally Unique Identifier.';

However, I would like this to work cleanly from Drush site upgrade. Any guidance on why these fields are not being added, and how this could be fixed in a more permanent way?

greg.1.anderson’s picture

Category: support » bug
Priority: Normal » Critical
Status: Active » Needs review
StatusFileSize
new980 bytes

Investigating a little further, I discovered that the missing uuid fields in my upgrade were not some sort of unusual edge case; there simply isn't an update function that adds the fields that are put in by the uuid_install() function. The fix is therefore trivial; just duplicate the operations done by install in an update function. The attached patch worked great for me. However, I did not include the call to uuid_sync_all(); I am not sure if that too might be necessary.

Please also roll a 6.x-beta3 release from the current 6.x-dev branch; otherwise, uuid-6.x users upgrading to Drupal 7 won't get even this far (unless they know to update to 6.x-dev first).

Status: Needs review » Needs work

The last submitted patch, uuid-update-install-uuid-fields.patch, failed testing.

greg.1.anderson’s picture

Priority: Critical » Normal
Status: Needs work » Needs review
StatusFileSize
new355 bytes

Heck, #2 shouldn't have failed testing. I guess the change wasn't so trivial after all. Here is a simpler change -- this is mostly for the test bot.

Status: Needs review » Needs work

The last submitted patch, uuid-update-install-uuid-fields-4.patch, failed testing.

greg.1.anderson’s picture

StatusFileSize
new373 bytes

Okay, test bot, this no-code-change patch is for you.

greg.1.anderson’s picture

Status: Needs work » Needs review

Ahem. Setting issue status.

Status: Needs review » Needs work

The last submitted patch, uuid-update-install-uuid-fields-6.patch, failed testing.

greg.1.anderson’s picture

Status: Needs work » Needs review

Could a human please help out here? It looks like uuid 7.x-dev HEAD is failing tests. Tests look okay by inspection; no time to work on this further right now. #2 is the preferred patch for this issue.

greg.1.anderson’s picture

Title: Cannot upgrade uuid-6.x-beta2 to uuid-7.x-1.0-alpha3: update uuid_6004 fails » Need a uuid_update_7102 function to make database adjustments now done by uuid_install
Version: 7.x-1.0-alpha3 » 7.x-1.x-dev

I had the wrong version set; patches above are against 7.x-1.x-dev, not 7.x-1.0-alpha3.

greg.1.anderson’s picture

dixon_’s picture

Assigned: Unassigned » dixon_

Awesome that we have someone that finally have time to test the upgrade path! Thanks very much Greg!

I've had some problems with the d.o test bot here as well. Locally all my tests pass though. I'll take a look at this shortly and commit and roll new releases for both 6.x and 7.x.

greg.1.anderson’s picture

StatusFileSize
new1.73 KB

Awesome -- thanks. I was thinking about it, and figured that the update function needs to call uuid_sync_all(), just like install does. This patch adds that call. I also added a couple of perhaps-slightly-excessive comments about what to do on the next schema update, to reduce deep-thinking requirements should something change again after a period of time has elapsed. Feel free to trim these if you wish. ("If I had more time, I would have written a shorter comment." :> )

dixon_’s picture

Status: Needs review » Fixed

I've tested the patch quite extensively and have now committed it to dev. I will probably roll a new release (the first beta) soon.

I changed one things though, and that was making sure the uuid.module file is included during upgrade. It's needed for the uuid_schema_field_definition() which lives there. I ran into some issue doing the upgrade with UUID disabled.

But I also found that the only way to upgrade from 6.x-1.x-dev to 7.x-1.x-dev without data loss is to first upgrade to 7.x-1.0-alpha1 and then upgrade the UUID module separately. The reason for this is because all sub-modules (that was removed for 7.x-1.0-alpha2) was responsible for data migrations from 6.x.

So it's just easiest to advice people to first upgrade to 7.x-1.0-alpha1 and then to following releases. I will probably adding an UPGRADE.txt explaining this.

dixon_’s picture

I added some notes about upgrading between major and minor versions here: http://drupalcode.org/project/uuid.git/blob/refs/heads/7.x-1.x:/UPGRADE.txt

That documentation does not mention anything about the trickiness with uuid_update_7102() and how we need to treat the next possible upgrade. That's developer documentation that sits fine in the comments made by greg.1.anderson in the patch from #13.

greg.1.anderson’s picture

Very glad to see this committed; thanks. The added UPGRADE.txt was very helpful. I also added another issue #1482586: Upgrading from UUID 6.x to 7.x, and from 7.x-1.0-alpha1 to later versions to discuss the upgrade path.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.