UPGRADE 2.11 KB
NEO 1.0
=======

The format of MySQL tables has changed in NEO 1.0 and there is no backward
compatibility or transparent migration, so you will have to use the following
SQL commands to migrate each storage from NEO 0.10.x::

  -- make sure 'tobj' is empty first
  CREATE TABLE new_data (id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, hash BINARY(20) NOT NULL UNIQUE, compression TINYINT UNSIGNED NULL, value LONGBLOB NULL) ENGINE = InnoDB SELECT DISTINCT obj.hash as hash, compression, value FROM obj, data WHERE obj.hash=data.hash ORDER BY serial;
  DROP TABLE data;
  RENAME TABLE new_data TO data;
  CREATE TABLE new_obj (partition SMALLINT UNSIGNED NOT NULL, oid BIGINT UNSIGNED NOT NULL, serial BIGINT UNSIGNED NOT NULL, data_id BIGINT UNSIGNED NULL, value_serial BIGINT UNSIGNED NULL, PRIMARY KEY (partition, serial, oid), KEY (partition, oid, serial), KEY (data_id)) ENGINE = InnoDB SELECT partition, oid, serial, data.id as data_id, value_serial FROM obj LEFT JOIN data ON (obj.hash=data.hash);
  DROP TABLE obj;
  RENAME TABLE new_obj TO obj;
  ALTER TABLE tobj CHANGE hash data_id BIGINT UNSIGNED NULL;

NEO 0.10
========

The format of MySQL tables has changed in NEO 0.10 and there is no backward
compatibility or transparent migration, so you will have to use the following
SQL commands to migrate each storage from NEO < 0.10::

  -- make sure 'tobj' is empty first
  DROP TABLE obj_short, tobj;
  ALTER TABLE obj CHANGE checksum hash BINARY(20) NULL;
  UPDATE obj SET value=NULL WHERE value='';
  UPDATE obj SET hash=UNHEX(SHA1(value));
  ALTER TABLE obj ADD KEY (hash(4));
  CREATE TABLE data (hash BINARY(20) NOT NULL PRIMARY KEY, compression TINYINT UNSIGNED NULL, value LONGBLOB NULL) ENGINE = InnoDB SELECT DISTINCT hash, compression, value FROM obj WHERE hash IS NOT NULL;
  ALTER TABLE obj DROP compression, DROP value;
  UPDATE obj, obj as undone SET obj.hash=undone.hash WHERE obj.value_serial IS NOT NULL AND obj.partition=undone.partition AND obj.oid=undone.oid AND obj.value_serial=undone.serial;

If 'tobj' is not empty, this means your cluster was not shutdown properly.
Restart it to flush the last committed transaction.