I've just installed Deployment on two installs. The source was upgraded from a D6 database. The upgrade went smoothly and all data is accessible.

The destination server is a D7 installation that came with a stock theme with many, many custom modules and intricacies that I'm quite sure I couldn't replicate on the upgraded db. Hence, I'm attempting to move the data into the stock database that comes with the theme.

Installation of deployment went fine on both sides. However, when I attempt to move across some nodes, it errors out with the following:

DeployServiceException: Service error: 406 Not Acceptable: Term object needs vid property. in DeployServiceRest->httpRequest() (line 70 of /Users/aangel/LocalDevelopment/htdocs/nrrd7/sites/all/modules/deploy/includes/DeployServiceRest.inc).

The taxonomy_term_data tables look virtually identical, the exception being that the fields are not in the same order. Here is the source:

CREATE TABLE `taxonomy_term_data` (
  `tid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `vid` int(10) unsigned NOT NULL DEFAULT '0',
  `name` varchar(255) NOT NULL DEFAULT '',
  `description` longtext,
  `weight` int(11) NOT NULL DEFAULT '0' COMMENT 'The weight of this term in relation to other terms.',
  `format` varchar(255) DEFAULT NULL COMMENT 'The filter_format.format of the description.',
  `uuid` char(36) NOT NULL DEFAULT '' COMMENT 'The Universally Unique Identifier.',
  PRIMARY KEY (`tid`),
  KEY `vid_name` (`vid`,`name`),
  KEY `name` (`name`),
  KEY `taxonomy_tree` (`vid`,`weight`,`name`),
  KEY `uuid` (`uuid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=108 ;

And here is the destination:

CREATE TABLE `taxonomy_term_data` (
  `tid` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary Key: Unique term ID.',
  `vid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'The taxonomy_vocabulary.vid of the vocabulary to which the term is assigned.',
  `name` varchar(255) NOT NULL DEFAULT '' COMMENT 'The term name.',
  `description` longtext COMMENT 'A description of the term.',
  `format` varchar(255) DEFAULT NULL COMMENT 'The filter_format.format of the description.',
  `weight` int(11) NOT NULL DEFAULT '0' COMMENT 'The weight of this term in relation to other terms.',
  `uuid` char(36) NOT NULL DEFAULT '' COMMENT 'The Universally Unique Identifier.',
  PRIMARY KEY (`tid`),
  KEY `taxonomy_tree` (`vid`,`weight`,`name`),
  KEY `vid_name` (`vid`,`name`),
  KEY `name` (`name`),
  KEY `uuid` (`uuid`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Stores term information.' AUTO_INCREMENT=27 ;

Key modules versions:
Deployment, Deployment UI 7.x-2.x-dev
Services 7.x-3.1+44-dev
UUID 7.x-1.0-alpha3+31-dev
UUID Services 7.x-1.0-alpha3+31-dev
Entity API 7.x-1.0-rc1
Entity Dependency API 7.x-1.0-alpha1+6-dev

Any idea how to proceed from here?

Comments

aspilicious’s picture

Do you have the same taxonomy vocabularies on both source and destination?

muka’s picture

Hi,
I got the same error. I've tried to add the vid for the taxonomy term like this:

// deploy/deploy.module
function deploy_deploy_entity_alter(&$entity, $type) {
  switch($type) {
    case 'taxonomy_term':
      $vocabulary = taxonomy_vocabulary_machine_name_load($entity->vocabulary_machine_name);
      $entity->vid = $vocabulary->vid;
      break;
  } 
}

But now I'm getting a SQLSTATE[01000]: Warning: 1265 Data truncated for column \'tid\' at row 1 because the tid are UUID

aspilicious’s picture

You need to deploy your taxonomy vocabularies first with features or by hand!

juliaset’s picture

I've used Features to set up the taxonomy vocabularies on the destination server, and I'm still getting this error when I try to deploy. Any other ideas?

emilorol’s picture

Hi,

I was able to get the VID property by adding the following code to "deploy.core.inc" base on the code muka first wrote:

<?php
/**
 * Implements hook_deploy_entity_alter().
 */
function taxonomy_deploy_entity_alter(&$entity, $entity_type) {
  if ($entity_type == 'taxonomy_term') {
      $vocabulary = taxonomy_vocabulary_machine_name_load($entity->vocabulary_machine_name);
      $entity->vid = $vocabulary->vid;
  }
}
?>
boobaa’s picture

Status: Active » Needs review
StatusFileSize
new688 bytes

Had the same problem, which was solved by the code in #5. Here it is as a patch.

timaholt’s picture

Tried the patch in #6, it solved the original 406 Service Error, but now I have:

DeployServiceException: Service error: 500 Internal Server Error: An error occurred (22007): SQLSTATE[22007]: Invalid datetime format: 1292 Truncated incorrect DOUBLE value:

Anyone seen that error after applying the patch?

timaholt’s picture

Nevermind, I realized I had neglected to enable the UUID Services module. Doh!

dixon_’s picture

Status: Needs review » Closed (works as designed)

This doesn't look completely right to me. What if the vid is different on the two sites? Then the patch in #6 wouldn't work.

Translating the vid needs to happen on the destination side, which we already are doing:

/**
 * Implements hook_entity_uuid_presave().
 */
function taxonomy_entity_uuid_presave(&$entity, $entity_type) {
  if ($entity_type == 'taxonomy_term') {
    // ...
    $vocabulary = taxonomy_vocabulary_machine_name_load($entity->vocabulary_machine_name);
    $entity->vid = $vocabulary->vid;
  }
}

The issue was reported over a year ago. So this code might not have been in place back then. So I'm assuming this works as designed at this point. Please re-open is the issue still exists.

weynhamz’s picture

Enable UUID Services module is the way to go.