11xto080Migration

There's no way to automatically migrate data from 1.1.x version to the new one.

Constant files migration

Migration classes

Object identifiers have changed : we're now using the class name as identifier, instead of a numerical index.

Tables

You need to rename each object's table and put it in plural.
For example table "glpi_plugin_genericobject_table" will become "glpi_plugin_genericobject_tables"

Field names have changed too. Here is an example :

Old field Old format New field New format
ID int(11) NOT NULL AUTO_INCREMENT id int(11) NOT NULL AUTO_INCREMENT
FK_entities int(11) NOT NULL DEFAULT '0' entities_id int(11) NOT NULL DEFAULT '0'
deleted int(1) NOT NULL DEFAULT '0' is_deleted tinyint(1) NOT NULL DEFAULT '0'
recursive int(1) NOT NULL DEFAULT '0' is_recursive tinyint(1) NOT NULL DEFAULT '0'
is_template int(1) NOT NULL DEFAULT '0' is_template tinyint(1) NOT NULL DEFAULT '0'
notes text COLLATE utf8_unicode_ci notepad text COLLATE utf8_unicode_ci
comments text COLLATE utf8_unicode_ci comment text COLLATE utf8_unicode_ci
location int(11) NOT NULL DEFAULT '0' locations_id int(11) NOT NULL DEFAULT '0'
type int(11) NOT NULL DEFAULT '0' plugin_genericobject_<itemtype>types_id int(11) NOT NULL DEFAULT '0'
model int(11) NOT NULL DEFAULT '0' plugin_genericobject_<itemtype>models_id int(11) NOT NULL DEFAULT '0'
FK_glpi_enterprise int(11) NOT NULL DEFAULT '0' manufacturers_id int(11) NOT NULL DEFAULT '0'
state int(11) NOT NULL DEFAULT '0' states_id int(11) NOT NULL DEFAULT '0'
FK_user int(11) NOT NULL DEFAULT '0' users_id int(11) NOT NULL DEFAULT '0'
FK_group int(11) NOT NULL DEFAULT '0' groups_id int(11) NOT NULL DEFAULT '0'

To learn more about internal changes, please read the following page : CleanDbStudy
h3. Dropdown tables

Each dropdown table must be renamed :

glpi_dropdown_plugin_genericobject_<itemtype>_model

Becomes :
glpi_plugin_genericobject_<itemtype>models

  1. Remove all classes files from the old version
  2. Create again your objects

Language files migration

To add you own language strings, you still need an external php file. Please note that the files will be created for :
  • the current user's language
  • the GLPI default language
    If you want to add more language file, simply copy/paste a file and rename it.

In the previous versions, language strings were matching the following pattern :

<?php
$LANG['genericobject']['<type name>'][1] = '<label>';
?>

Now if shoud be :
<?php
$LANG['genericobject']['<class name>'][1] = '<label>';
?>

For example,

 $LANG['genericobject']['table'][1] = "Table";
will become
$LANG['genericobject']['PluginGenericobjectTable'][1] = "Table";

Field definition files

Variable

$GENERICOBJECT_AVAILABLE_FIELDS
has been renamed in
$GO_FIELDS