Contents

将数据模型迁移到2.0

数据迁移与iTop升级

iTop 2.0随附两种数据模型:

  • 与iTop 1.x完全兼容的1.3数据模型。唯一的区别是一些错误修复以及对用户可编辑仪表板的支持。
  • 2.0数据模型使用了截然不同的概念,并且设计得更加整洁和模块化,但不一定与1.x数据模型保持一致。

使用iTop的设置流程升级应用时,先前(非自定义)1.x实例的数据-模型将自动迁移到1.3数据-模型。

iTop的“核心”引擎已升级到2.0代码库,并提供了新版本(用户可配置列表和仪表板,快捷方式等)的所有增强功能和错误修复。

另一方面,“数据迁移”包括使用iTop 1.x数据-数据将存储在数据库中的数据转换为新的2.0数据模型。由于两个型号明显不同,因此该数据无法完全自动化。

我需要将数据迁移到2.0数据-数据吗?

如果您对iTop 1.2的数据模型感到满意,并且不希望计划记录仅由2.0数据-模型覆盖的IT基础设施片段,则无需将数据“迁移”到2.0。

仅当您要使用(部分)iTop 2.0的新数据-数据时,才需要迁移数据。在所有其他情况下,您可以依靠自动模型。

用户可配置的仪表板和自定义的1.x数据模型

对于那些自定义其1.x数据模型并希望从用户可编辑仪表板中受益而又不迁移到2.0数据模型的用户来说,这是一个特殊情况。

升级iTop时,安装程​​序会将先前实例(位于“模块”目录中)的所有数据模型文件的签名与相应的1.x正版版本的签名进行比较。如果在这些文件之一中检测到任何修改,则提示终端用户是否保留修改。如果用户回答要保留修改,则整个“模块”文件夹将用作数据-模型定义。否则,将使用标准1.3模型。

由于用户可编辑仪表板是一种特殊的菜单节点,因此它们是数据-模型定义的一部分。通过在自定义的1.x数据-模型中用DashboardMenuNodes替换TemplateMenuNode实例,您可以从新的特性中受益。

  • 在开发计算机上,安装自定义的1.x iTop实例
  • 使用带有2.0 iTop软件包的标准升级规程到升级
  • 当提示您保留或放弃您的修改时,告诉安装程序保留它们
  • 在此iTop新实例上安装2.0工具包
  • 编辑数据模型,添加一个新的“空” DasbhoardMenuNode菜单项。运行工具包以应用您的修改
  • 使用交互式编辑器仪表板编辑器将设计用作仪表板,就像任何仪表板都是定制化自己拥有的仪表板
  • 使用菜单“导出到文件…”保存定制的仪表板。
  • 在新的数据模型中的DashboardMenuNode的定义中复制粘贴生成的XML。
  • 使用工具包应用修改。
  • 连接到iTop并选择“还原为原始版本…”以检查自定义设置是否已成为数据模型的一部分。
  • 从数据模型中删除不需要的TemplateMenuNode
  • 升级通过新定制的数据模型您的生产实例

迁移方案概述

请注意,迁移方案尚不支持工单或附件!

Overall Migration Process

如果要将1.x iTop实例迁移到新的2.0数据模型,则以下是流程的概述:

  • 升级将您的“旧” iTop实例升级为2.0。这会将升级的数据-模型模式提高到1.3,并为您的iTop实例带来代码增强和错误修复的所有好处(尤其是在数据数据功能方面)。
  • 在相同的数据库服务器上,但在不同的数据库上,安装XTopic的品牌新实例,该实例将接收到您迁移的数据,以及所需的来自2.0数据-数据库的模块组合。不要在此实例上安装“ Demo”数据。
  • 使用SQL脚本(见下文)将组织,文档,联系人和用户记录从旧实例转移到新实例。 SQL脚本还将为您创建所有新的类型。
  • 对于其余类别:服务器,PC,网络设备,服务,合同等…,请使用CSV导出和CSV导入功能按以下说明的顺序传输数据。

常见的迁移陷阱

为什么在iTop 1.2.1和iTop 2.0之间没有简单的映射?

在某些情况下,两个数据模型(1.x和2.0)有很大不同,并且不可能进行简单的自动映射。下面列出了需要此类手册干预的主要情况:

班级划分

1.x数据模型中缺少一些概念。例如,在iTop 1.2.1中,没有诸如“虚拟机”这样的东西。在许多情况下,虚拟机只是使用“服务器”对象记录的。现在,iTop 2.0中已经存在“虚拟机”对象,因此要从旧的虚拟机-模型迁移到新的数据,需要区分服务器和虚拟机。执行此“拆分”的方式依赖于您在iTop中输入的虚拟机。您可能很幸运,已经使用了严格的命名约定来区分服务器和VM,在这种情况下,Excel中的简单sort/filter可以解决问题。在其他情况下,您可能需要一个一个地对象虚拟机(例如,在Excel中或通过在iTop中创建两个组)。

类型学

已关闭枚举列表或纯文本字段中的某些字段已变成可配置的枚举,在“类型学”(Typology)伞下分组在一起。

示例:品牌和模型。

此类字段的转换由下面提供的SQL脚本处理。您可能仍然需要评审并清理数据,以获取几乎重复的副本,例如“ Hewlett Packard”,“ Hewlett-Packard”,甚至更糟的是“ HP”。

限制不再支持的功能

从2.0数据-模型中删除了许多功能:要么是因为有其他(更好的方法)来记录相同类型的信息,要么是因为它们在大多数情况下都是无用的且过于混乱。在这种情况下,迁移到标准2.0数据-模型将导致数据丢失。

例子:

  • 一个小组不能再成为另一个小组的成员。
  • 分层中不再包含位置(不再存在父位置)

名称重复

如果您有多个具有相同名称的相同类的对象,请注意,其他对象的重新导入指向此类“重复项”可能具有挑战性。

结构不同

2.0数据-模型更改了记录某些信息的结构。在某些情况下,在1.x中的元素和2.x中的元素之间没有简单的一对一映射。例如,在1.x中,通过将接口连接在一起来记录网络连接。由于这对于大多数用户来说是令人困惑的(且难以记录),因此在2.0数据-模型中引入了设备之间更简单,直接的关系。但是,可以在两个模型之间转移网络拓扑,但这需要对数据进行一些简单的处理。

操作顺序

当您的两个实例准备好用于迁移时,请按照下列步骤操作:

  • 下载下面的SQL脚本,并在常用文本编辑器中使用find/replace调整源数据库和目标数据库的名称。在下面的SQL中,源数据库名为itop1x,目标数据库称为itop20。
1x_to-20_migration.sql
/**
 * Organization
*/
TRUNCATE TABLE itop20.organization;
INSERT INTO itop20.organization (id, name, code, STATUS, parent_id, parent_id_left, parent_id_right)
  SELECT id, name, code, STATUS, parent_id, parent_id_left, parent_id_right FROM itop1x.organization;
 
 
/**
 * Typology
*/
TRUNCATE TABLE itop20.typology;
 
/**
 * Typology - DocumentType
*/
INSERT INTO itop20.typology (name, finalclass)
 SELECT DISTINCT TYPE, 'DocumentType' FROM itop1x.document WHERE TYPE IS NOT NULL;
 
TRUNCATE TABLE itop20.documenttype;
INSERT INTO itop20.documenttype (id)
 SELECT id FROM itop20.typology WHERE finalclass = 'DocumentType';
 
/**
 * Document
*/
TRUNCATE TABLE itop20.document;
/**
 * Document - DocumentFile
*/
INSERT INTO itop20.document (id, name, org_id, documenttype_id, description, STATUS, finalclass)
SELECT 
    SOURCE.id,
    SOURCE.name,
    SOURCE.org_id,
    typo.id,
    SOURCE.description,
    SOURCE.status,
    'DocumentFile'
FROM
    itop1x.document AS SOURCE
        LEFT JOIN
    itop20.typology AS typo ON SOURCE.type = typo.name
WHERE SOURCE.finalclass = 'FileDoc';
 
TRUNCATE TABLE itop20.documentfile;
INSERT INTO itop20.documentfile (id, file_data, file_mimetype, file_filename)
SELECT id, contents_data, contents_mimetype, contents_filename FROM itop1x.filedoc;
 
/**
 * Document - DocumentNote
*/
INSERT INTO itop20.document (id, name, org_id, documenttype_id, description, STATUS, finalclass)
SELECT 
    SOURCE.id,
    SOURCE.name,
    SOURCE.org_id,
    typo.id,
    SOURCE.description,
    SOURCE.status,
    'DocumentNote'
FROM
    itop1x.document AS SOURCE
        LEFT JOIN
    itop20.typology AS typo ON SOURCE.type = typo.name
WHERE SOURCE.finalclass = 'Note';
 
TRUNCATE TABLE itop20.documentnote;
INSERT INTO itop20.documentnote (id, text)
SELECT id, note FROM itop1x.note;
 
/**
 * Document - DocumentWeb
*/
INSERT INTO itop20.document (id, name, org_id, documenttype_id, description, STATUS, finalclass)
SELECT 
    SOURCE.id,
    SOURCE.name,
    SOURCE.org_id,
    typo.id,
    SOURCE.description,
    SOURCE.status,
    'DocumentWeb'
FROM
    itop1x.document AS SOURCE
        LEFT JOIN
    itop20.typology AS typo ON SOURCE.type = typo.name
WHERE SOURCE.finalclass = 'WebDoc';
 
TRUNCATE TABLE itop20.documentweb;
INSERT INTO itop20.documentweb (id, url)
SELECT id, url FROM itop1x.externaldoc;
 
/**
 * Location
*/
TRUNCATE TABLE itop20.location;
INSERT INTO itop20.location (name, STATUS, org_id, address, postal_code, city, country)
SELECT name, STATUS, org_id, address, postal_code, city, country FROM itop1x.location;
 
/**
 * Contact
*/
TRUNCATE TABLE itop20.contact;
 
/**
 * Contact - Person
*/
INSERT INTO itop20.contact (id, name, STATUS, org_id, email, phone, finalclass)
SELECT
    id, name, STATUS, org_id, email, phone, 'Person'
FROM
    itop1x.contact
WHERE finalclass = 'Person';
 
TRUNCATE TABLE itop20.person;
INSERT INTO itop20.person (id, first_name, employee_number, location_id)
SELECT p.id, p.first_name, p.employee_id, c.location_id FROM itop1x.person AS p JOIN itop1x.contact AS c ON c.id = p.id;
 
/**
 * Contact - Team
*/
INSERT INTO itop20.contact (id, name, STATUS, org_id, email, phone, finalclass)
SELECT
    id, name, STATUS, org_id, email, phone, 'Team'
FROM
    itop1x.contact
WHERE finalclass = 'Team';
 
TRUNCATE TABLE itop20.team;
INSERT INTO itop20.team (id)
SELECT id FROM itop1x.team;
 
/**
 * Person to Team
*/
INSERT INTO itop20.typology (name, finalclass)
 SELECT DISTINCT ROLE, 'ContactType' FROM itop1x.lnkteamtocontact WHERE ROLE !='';
 
TRUNCATE TABLE itop20.contacttype;
INSERT INTO itop20.contacttype (id)
 SELECT id FROM itop20.typology WHERE finalclass = 'ContactType';
 
TRUNCATE TABLE itop20.lnkpersontoteam;
INSERT INTO itop20.lnkpersontoteam (team_id, person_id, role_id)
 SELECT l.team_id, l.contact_id, t.id
 FROM itop1x.lnkteamtocontact AS l LEFT JOIN itop20.typology AS t ON l.ROLE = t.name;
 
/**
 * User management
*/
TRUNCATE TABLE itop20.priv_user;
INSERT INTO itop20.priv_user SELECT * FROM itop1x.priv_user;
TRUNCATE TABLE itop20.priv_internaluser;
INSERT INTO itop20.priv_internaluser SELECT * FROM itop1x.priv_internaluser;
TRUNCATE TABLE itop20.priv_user_local;
INSERT INTO itop20.priv_user_local SELECT * FROM itop1x.priv_user_local;
TRUNCATE TABLE itop20.priv_urp_userorg;
INSERT INTO itop20.priv_urp_userorg SELECT * FROM itop1x.priv_urp_userorg;
TRUNCATE TABLE itop20.priv_urp_profiles;
INSERT INTO itop20.priv_urp_profiles SELECT * FROM itop1x.priv_urp_profiles;
TRUNCATE TABLE itop20.priv_urp_userprofile;
INSERT INTO itop20.priv_urp_userprofile SELECT * FROM itop1x.priv_urp_userprofile;

            连接到MySQL服务器并运行SQL脚本。这将导入的组织,文档,联系人,位置,用户,并在新的数据库中创建所有类型(不是所有FIXME)对象。

  • 使用CSV导出(交互或脚本)将来自“旧”实例的以下导出用作导出。
  • 在新实例上使用CSV导入(最好是脚本以避免超时),并按照以下顺序将导入和导入配合使用,并具有以下字段映射:

组织

字段映射

源字段目标字段
namename
codecode
statusstatus
parent_idparent_id

位置

字段映射

源字段目标字段
namename
statusstatus
org_idorg_id
addressaddress
postal_codepostal_code
citycity
countrycountry

位置不再是分层的一部分。

字段映射

源字段目标字段
namename
statusstatus
org_idorg_id
emailemail
phonephone
first_namefirst_name
employee_idemployee_number
location_idlocation_id

球队

字段映射

源字段目标字段
namename
statusstatus
org_idorg_id
emailemail
phonephone

文件说明

字段映射

源字段目标字段
namename
org_idorg_id
descriptiondescription
statusstatus
notetext

DocumentWeb

字段映射

源字段目标字段
namename
org_idorg_id
descriptiondescription
statusstatus
urlurl

网络设备

字段映射

源字段目标字段
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
serial_numberserialnumber
location_idlocation_id
statusstatus
brand starbrand_id
model starmodel_id
asset_refasset_number
management_ipmanagementip
type starnetworkdevicetype_id
ios_version stariosversion_id
ramram

SNMP read/write,default_gateway和location_details不再是标准模型的一部分。

服务器

字段映射

源字段目标字段
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
serial_numberserialnumber
location_idlocation_id
statusstatus
brand starbrand_id
model starmodel_id
asset_refasset_number
management_ipmanagementip
os_family starosfamily_id
os_version starosversion_id
cpucpu
ramram

个人电脑

字段映射

源字段目标字段
amename
org_idorg_id
importancebusiness_criticity
serial_numberserialnumber
statusstatus
brand starbrand_id
model starmodel_id
asset_refasset_number
os_family starosfamily_id
os_version starosversion_id
cpucpu
ramram

打印机

字段映射

源字段目标字段
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
serial_numberserialnumber
location_idlocation_id
statusstatus
brand starbrand_id
model starmodel_id
asset_refasset_number

移动电话

字段映射

源字段目标字段
namename
org_idorg_id
importancebusiness_criticity
serial_numberserialnumber
statusstatus
brand starbrand_id
model starmodel_id
asset_refasset_number
numberphonenumber
imeiimei
hw_pinhw_pin

应用解决方案

字段映射

源字段目标字段
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
statusstatus

业务流程

字段映射

源字段目标字段
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
statusstatus

数据库服务器

字段映射

源字段目标字段
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
device_idsystem_id
software_idsoftware_id
licence_idsoftwarelicence_id
statusstatus

其他软件

字段映射

源字段目标字段
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
device_idsystem_id
software_idsoftware_id
licence_idsoftwarelicence_id
statusstatus

数据库架构

字段映射

源字段目标字段
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
db_server_instance_iddbserver_id

软件许可

字段映射

源字段目标字段
namename
descriptiondescription
org_idorg_id
importanceusage_limite
start_datestart_date
end_dateend_date
licence_keylicence_key
usage_limitusage_limit

lnkContactToFunctionalCI

字段映射

源字段目标字段
ci_idfunctionalci_id
contact_idcontact_id

2.0中不再有角色版本

lnkDocumentToFunctionalCI

字段映射

源字段目标字段
ci_idfunctionalci_id
document_iddocument_id

子网

字段映射

源字段目标字段
descriptiondescription
org_idorg_id
ipip
ip_maskip_mask

物理接口

字段映射

源字段目标字段
namename
ip_addressipaddress
mac_addressmacaddress
serial_numbercomment
ip_maskipmask
speedspeed
device_idconnectableci_id

lnkConnectableCIToNetworkDevice

字段映射

源字段目标字段
source(if_dev)→device_idnetworkdevice_id
source(if_ci)→device_idconnectableci_id
source(if_dev)→namenetwork_port
source(if_ci)→namedevice_port
source(if_dev)→link_typeconnection_type

lnkApplicationSolutionToFunctionalCI

字段映射

源字段目标字段
solution_idapplicationsolution_id
ci_idfunctionalci_id

lnkApplicationSolutionToBusinessProcess

字段映射

源字段目标字段
solution_idapplicationsolution_id
process_idbusinessprocess_id

lnkPersonToTeam

字段映射

源字段目标字段
team_idteam_id
contact_idperson_id

字段映射

源字段目标字段
namename
statusstatus
org_idorg_id
descriptiondescription
typetype
parent_idparent_id

lnkGroupToCI

字段映射

源字段目标字段
group_idgroup_id
ci_idci_id
reasonreason

客户合同

字段映射

源字段目标字段
namename
org_idorg_id
descriptiondescription
start_datestart_date
end_dateend_date
costcost
cost_currencycost_currency
billing_frequencybilling_frequency
cost_unitcost_unit
provider_idprovider_id

提供商合同

字段映射

源字段目标字段
namename
org_idorg_id
descriptiondescription
start_datestart_date
end_dateend_date
costcost
cost_currencycost_currency
billing_frequencybilling_frequency
cost_unitcost_unit
provider_idprovider_id
slasla
coveragecoverage

lnkContactToContract

字段映射

源字段目标字段
contact_idcontact_id
contract_idcontract_id

lnkContractToDocument

字段映射

源字段目标字段
document_iddocument_id
contract_idcontract_id

服务

字段映射

源字段目标字段
namename
org_idorg_id
descriptiondescription
statusstatus

lnkDocumentToService

字段映射

源字段目标字段
ocument_iddocument_id
service_idservice_id

lnkContactToService

字段映射

源字段目标字段
contact_idcontact_id
service_idservice_id

角色在2.0数据模型中不再使用

服务子类别

字段映射

源字段目标字段
namename
descriptiondescription
service_idservice_id
'incident'request_type
'production'status

斯拉

字段映射

源字段目标字段
namename
1org_id

SLT

字段映射

源字段目标字段
namename
ticket_prioritypriority
metricmetric
valuevalue
value_unitunit

lnkSLAToSLT

字段映射

源字段目标字段
sla_idsla_id
slt_idslt_id

lnkCustomerContractToService

字段映射

源字段目标字段
source(lnk)→contract_idcustomercontract_id
source(sla)→service_idservice_id
source(lnk)→sla_idsla_id

lnkCustomerContractToProviderContract

字段映射

源字段目标字段
customer_contract_idcustomercontract_id
provider_contract_idprovidercontract_id

问题

字段映射

源字段目标字段
refref
org_idorg_id
agent_idagent_id
titletitle
descriptiondescription
start_datestart_date
last_updatelast_update
close_dateclose_date
statusstatus
service_idservice_id
servicesubcategory_idservicesubcategory_id
productproduct
impactimpact
urgencyurgency
prioritypriority
related_change_idrelated_change_id
assignment_dateassignment_date
resolution_dateresolution_date

例行变更

字段映射

源字段目标字段
refref
org_idorg_id
agent_idagent_id
titletitle
descriptiondescription
start_datestart_date
end_dateend_date
last_updatelast_update
close_dateclose_date
statusstatus
reasonreason
requestor_idrequestor_id
creation_datecreation_date
impactimpact
supervisor_group_idsupervisor_group_id
supervisor_idsupervisor_id
manager_group_idmanager_group_id
manager_idmanager_id
outageoutage
fallbackfallback

正常变化

字段映射

源字段目标字段
refref
org_idorg_id
agent_idagent_id
titletitle
descriptiondescription
start_datestart_date
end_dateend_date
last_updatelast_update
close_dateclose_date
statusstatus
reasonreason
requestor_idrequestor_id
creation_datecreation_date
impactimpact
supervisor_group_idsupervisor_group_id
supervisor_idsupervisor_id
manager_group_idmanager_group_id
manager_idmanager_id
outageoutage
fallbackfallback
approval_dateapproval_date
approval_commentapproval_comment
acceptance_dateacceptance_date
acceptance_commentacceptance_comment

紧急变更

字段映射

源字段目标字段
refref
org_idorg_id
agent_idagent_id
titletitle
descriptiondescription
start_datestart_date
end_dateend_date
last_updatelast_update
close_dateclose_date
statusstatus
reasonreason
requestor_idrequestor_id
creation_datecreation_date
impactimpact
supervisor_group_idsupervisor_group_id
supervisor_idsupervisor_id
manager_group_idmanager_group_id
manager_idmanager_id
outageoutage
fallbackfallback
approval_dateapproval_date
approval_commentapproval_comment

lnkContactToTicket

字段映射

源字段目标字段
rolerole
ticket_idticket_id
contact_idcontact_id
  
  
  

lnkFunctionalCIToTicket

字段映射

源字段目标字段
impactimpact
ticket_idticket_id
ci_idfunctionalci_id

已知错误

字段映射

源字段目标字段
namename
org_idorg_id
problem_idproblem_id
symptomsymptom
root_causeroot_cause
workaroundworkaround
solutionsolution
error_codeerror_code
domaindomain
vendorvendor
modelmodel
versionversion

lnkErrorToFunctionalCI

字段映射

源字段目标字段
error_iderror_id
infra_idfunctionalci_id
reasonreason

lnkDocumentToError

字段映射

源字段目标字段
error_iderror_id
doc_iddocument_id
link_typelink_type

用户请求

字段映射

源字段目标字段
refref
org_idorg_id
caller_idcaller_id
agent_idagent_id
titletitle
descriptiondescription
start_datestart_date
last_updatelast_update
close_dateclose_date
statusstatus
request_typerequest_type
impactimpact
prioritypriority
urgencyurgency
service_idservice_id
servicesubcategory_idservicesubcategory_id
assignment_dateassignment_date
resolution_dateresolution_date
tto_escalation_deadlinetto_escalation_deadline
ttr_escalation_deadlinettr_escalation_deadline
resolution_coderesolution_code
solutionsolution
user_satisfactionuser_satisfaction

原创链接:https://www.itophub.io/wiki/page?id=2_7_0%3Ainstall%3A1_to_2_upgrade


iTop 1.x to 2.0 migration instructions

Data migration versus iTop upgrade

iTop 2.0 ships with two data-models:

  • The 1.3 data model which is fully compatible with iTop 1.x. The only differences are a few bug fixes and the support of user-editable dashboards.

  • The 2.0 data model which uses quite different concepts and was designed to be cleaner and more modular, but not necessarily aligned with the 1.x data model.

When upgrading the application using the setup process of iTop, the data-model of a previous (non-customized) 1.x instance is automatically migrated to the 1.3 data-model.

The “core” engine of iTop is upgraded to the 2.0 codebase and provides all the enhancements and bug fixes of the new version (user configurable lists and dashboards, shortcuts, etc.)

A “data migration”, on the other hand, consists in transforming the data stored in the database using the iTop 1.x data-model into the new 2.0 data model. Since the two models are significantly different, this process cannot be completely automated.

Do I need to migrate my data to the 2.0 data-model?

If you are happy with the data model of iTop 1.2 and don’t plan to document pieces of your IT infrastructure that are only covered by the 2.0 data-model, you don’t need to “migrate” your data to 2.0.

You need to migrate your data only if you want to use (some part of) the new data-model of iTop 2.0. In all other cases you can rely on the automatic upgrade.

User configurable dashboards and customized 1.x data-models

This is a special case for those who customized their 1.x data model and want to benefit from user editable dashboards without migrating to the 2.0 data model.

When upgrading iTop, the setup compares the signature of all the data model files of the previous instance (located in the “modules” directory) with the signature of a corresponding 1.x genuine version. If any modification is detected in one of these files, the end-user is prompted whether or not to preserve the modifications. If the user answers to keep the modifications, then the whole “modules” folder will be used as the data-model definition. Otherwise a standard 1.3 model is used.

Since the User Editable dashboards are a special kind of Menu Node they are part of the data-model definition. You can benefit from the new feature by replacing the TemplateMenuNode instances by DashboardMenuNodes in your customized 1.x data-model.

  • On a development machine, install your customized 1.x iTop instance

  • Use the standard upgrade procedure to upgrade it with the 2.0 iTop package

  • When prompted to keep or discard your modifications, tell the setup to keep them

  • Install the 2.0 toolkit on this new instance of iTop

  • Edit the data model to add a new “empty” DasbhoardMenuNode menu item. Run the toolkit to apply your modifications

  • Use the interactive editor dashboard editor to design your dashboard, as any user would be when customizing her/his own dashboard

  • Save the customized dashboard using the menu “Export to file…”

  • Copy/paste the resulting XML in the definition of the DashboardMenuNode in your new data model.

  • Use the toolkit to apply the modifications.

  • Connect to iTop and select “Revert to Original Version…” to check that the customization is now part of your data model.

  • Remove the un-needed TemplateMenuNode from your data model

  • Upgrade your production instance with newly customized data model

Migration scenario overview

Be aware that the migration scenario supports neither the Tickets nor the Attachments yet!

Overall Migration Process

If you want to migrate your 1.x iTop instance to the new 2.0 data model, here is an overview of the process:

  • Upgrade your “old” iTop instance to 2.0. This will upgrade the data-model schema to 1.3 and bring to your iTop instance all the benefits of the code enhancements and bug fixes (especially in terms of data export capabilities).

  • On the same database server, but in a different database, install a brand new instance of iTop that will receive your migrated data with the desired combination of modules from the 2.0 data-model. Don’t install the “Demo” data on this instance.

  • Use the SQL script (see below) to transfer the Organizations, Documents, Contacts and User records from the old instance to the new instance. The SQL script will also create all the new Typology for you.

  • For the remaining classes: Servers, PCs, Network Devices, Services, Contracts, etc… use the CSV export and CSV import features to transfer the data in the order explained below.

Common migration pitfalls

Why is there no simple mapping between iTop 1.2.1 and iTop 2.0?

There are several cases where the two data models (1.x and 2.0) are significantly different and where a simple automated mapping is not possible. The major cases where such a manual intervention is required are listed below:

Split of classes

Some concepts were absent from the 1.x data model. For example in iTop 1.2.1 there was no such thing as a “Virtual Machine”. In many cases the Virtual Machines were just documented using the “Server” object. Now that the “Virtual Machine” object exists in iTop 2.0, migrating from the old data-model to the new one requires distinguishing between servers and virtual machines. The way to perform this “split” depends on the data you entered in iTop. You may be fortunate enough to have used a strict naming convention that distinguishes servers from VMs, in which case a simple sort/filter in Excel can do the trick. In other cases you may need to review the data one by one (either in Excel or by creating two groups in iTop for instance).

Typology

Some of the fields that were either closed enumerated lists or plain-text fields have been turned into configurable enumeration, grouped together under the “Typology” umbrella.

Example: Brand and Model.

The transformation of such fields is handled by the SQL script provided below. You may still need to review and cleanup the data for near duplicates like “Hewlett Packard”, “Hewlett-Packard” or, even worse, “HP”.

Limitations / no more supported features

A number of features were removed from the 2.0 data-model: either because there are other (better?) ways of documenting the same kind of information or because they were useless and too confusing in most cases. In such case, migrating to the standard 2.0 data-model will result in a loss of data.

Examples:

  • A Team can no longer be a member of another Team.

  • Locations are no longer in a hierarchy (there is no parent location anymore)

Duplicate names

If you have several objects of the same class that have the same name, be aware that the re-import of other objects that point to such “duplicates” can be challenging.

Different structure

The structure for documenting some information changed with the 2.0 data-model. In some cases there is no simple one to one mapping between the elements in 1.x and the elements in 2.x. for example, in 1.x the network connections were documented by connecting interfaces together. Since this was confusing (and hard to document) for most of the users, a simpler, direct relation between the devices was introduced in the 2.0 data-model. It is however possible to transfer the network topology between both models, but this requires some non-trivial processing of the data.

Order of operations

Once your two instances are ready for the migration, proceed as follows:

  • Download the SQL script below and use find/replace in your favorite text editor to ajust the names of the source and destination databases. The source database is named itop1x in the SQL below and the destination database is named itop20.

1x_to-20_migration.sql
 
/**
 * Organization
*/
TRUNCATE TABLE itop20.organization;
INSERT INTO itop20.organization (id, name, code, STATUS, parent_id, parent_id_left, parent_id_right)
  SELECT id, name, code, STATUS, parent_id, parent_id_left, parent_id_right FROM itop1x.organization;
 
 
/**
 * Typology
*/
TRUNCATE TABLE itop20.typology;
 
/**
 * Typology - DocumentType
*/
INSERT INTO itop20.typology (name, finalclass)
 SELECT DISTINCT TYPE, 'DocumentType' FROM itop1x.document WHERE TYPE IS NOT NULL;
 
TRUNCATE TABLE itop20.documenttype;
INSERT INTO itop20.documenttype (id)
 SELECT id FROM itop20.typology WHERE finalclass = 'DocumentType';
 
/**
 * Document
*/
TRUNCATE TABLE itop20.document;
/**
 * Document - DocumentFile
*/
INSERT INTO itop20.document (id, name, org_id, documenttype_id, description, STATUS, finalclass)
SELECT 
    SOURCE.id,
    SOURCE.name,
    SOURCE.org_id,
    typo.id,
    SOURCE.description,
    SOURCE.status,
    'DocumentFile'
FROM
    itop1x.document AS SOURCE
        LEFT JOIN
    itop20.typology AS typo ON SOURCE.type = typo.name
WHERE SOURCE.finalclass = 'FileDoc';
 
TRUNCATE TABLE itop20.documentfile;
INSERT INTO itop20.documentfile (id, file_data, file_mimetype, file_filename)
SELECT id, contents_data, contents_mimetype, contents_filename FROM itop1x.filedoc;
 
/**
 * Document - DocumentNote
*/
INSERT INTO itop20.document (id, name, org_id, documenttype_id, description, STATUS, finalclass)
SELECT 
    SOURCE.id,
    SOURCE.name,
    SOURCE.org_id,
    typo.id,
    SOURCE.description,
    SOURCE.status,
    'DocumentNote'
FROM
    itop1x.document AS SOURCE
        LEFT JOIN
    itop20.typology AS typo ON SOURCE.type = typo.name
WHERE SOURCE.finalclass = 'Note';
 
TRUNCATE TABLE itop20.documentnote;
INSERT INTO itop20.documentnote (id, text)
SELECT id, note FROM itop1x.note;
 
/**
 * Document - DocumentWeb
*/
INSERT INTO itop20.document (id, name, org_id, documenttype_id, description, STATUS, finalclass)
SELECT 
    SOURCE.id,
    SOURCE.name,
    SOURCE.org_id,
    typo.id,
    SOURCE.description,
    SOURCE.status,
    'DocumentWeb'
FROM
    itop1x.document AS SOURCE
        LEFT JOIN
    itop20.typology AS typo ON SOURCE.type = typo.name
WHERE SOURCE.finalclass = 'WebDoc';
 
TRUNCATE TABLE itop20.documentweb;
INSERT INTO itop20.documentweb (id, url)
SELECT id, url FROM itop1x.externaldoc;
 
/**
 * Location
*/
TRUNCATE TABLE itop20.location;
INSERT INTO itop20.location (name, STATUS, org_id, address, postal_code, city, country)
SELECT name, STATUS, org_id, address, postal_code, city, country FROM itop1x.location;
 
/**
 * Contact
*/
TRUNCATE TABLE itop20.contact;
 
/**
 * Contact - Person
*/
INSERT INTO itop20.contact (id, name, STATUS, org_id, email, phone, finalclass)
SELECT
    id, name, STATUS, org_id, email, phone, 'Person'
FROM
    itop1x.contact
WHERE finalclass = 'Person';
 
TRUNCATE TABLE itop20.person;
INSERT INTO itop20.person (id, first_name, employee_number, location_id)
SELECT p.id, p.first_name, p.employee_id, c.location_id FROM itop1x.person AS p JOIN itop1x.contact AS c ON c.id = p.id;
 
/**
 * Contact - Team
*/
INSERT INTO itop20.contact (id, name, STATUS, org_id, email, phone, finalclass)
SELECT
    id, name, STATUS, org_id, email, phone, 'Team'
FROM
    itop1x.contact
WHERE finalclass = 'Team';
 
TRUNCATE TABLE itop20.team;
INSERT INTO itop20.team (id)
SELECT id FROM itop1x.team;
 
/**
 * Person to Team
*/
INSERT INTO itop20.typology (name, finalclass)
 SELECT DISTINCT ROLE, 'ContactType' FROM itop1x.lnkteamtocontact WHERE ROLE !='';
 
TRUNCATE TABLE itop20.contacttype;
INSERT INTO itop20.contacttype (id)
 SELECT id FROM itop20.typology WHERE finalclass = 'ContactType';
 
TRUNCATE TABLE itop20.lnkpersontoteam;
INSERT INTO itop20.lnkpersontoteam (team_id, person_id, role_id)
 SELECT l.team_id, l.contact_id, t.id
 FROM itop1x.lnkteamtocontact AS l LEFT JOIN itop20.typology AS t ON l.ROLE = t.name;
 
/**
 * User management
*/
TRUNCATE TABLE itop20.priv_user;
INSERT INTO itop20.priv_user SELECT * FROM itop1x.priv_user;
TRUNCATE TABLE itop20.priv_internaluser;
INSERT INTO itop20.priv_internaluser SELECT * FROM itop1x.priv_internaluser;
TRUNCATE TABLE itop20.priv_user_local;
INSERT INTO itop20.priv_user_local SELECT * FROM itop1x.priv_user_local;
TRUNCATE TABLE itop20.priv_urp_userorg;
INSERT INTO itop20.priv_urp_userorg SELECT * FROM itop1x.priv_urp_userorg;
TRUNCATE TABLE itop20.priv_urp_profiles;
INSERT INTO itop20.priv_urp_profiles SELECT * FROM itop1x.priv_urp_profiles;
TRUNCATE TABLE itop20.priv_urp_userprofile;
INSERT INTO itop20.priv_urp_userprofile SELECT * FROM itop1x.priv_urp_userprofile;
  • Connect to the MySQL server and run the SQL script. This will import the Organizations, Documents, Contacts, Locations, Users and will create all the Typology (not yet all FIXME) objects in the new database.

  • Use the CSV export (either interactive or scripted) to export the following data from the “old” instance.

  • Use the CSV import (preferably scripted to avoid timeouts) on the new instance to import the data in the following order, and with the following field mapping:

Organization

Fields Mapping

Source FieldDestination Field
namename
codecode
statusstatus
parent_idparent_id

Location

Fields Mapping

Source FieldDestination Field
namename
statusstatus
org_idorg_id
addressaddress
postal_codepostal_code
citycity
countrycountry

Locations are not longer part of a hierarchy.

Person

Fields Mapping

Source FieldDestination Field
namename
statusstatus
org_idorg_id
emailemail
phonephone
first_namefirst_name
employee_idemployee_number
location_idlocation_id

Team

Fields Mapping

Source FieldDestination Field
namename
statusstatus
org_idorg_id
emailemail
phonephone

DocumentNote

Fields Mapping

Source FieldDestination Field
namename
org_idorg_id
descriptiondescription
statusstatus
notetext

DocumentWeb

Fields Mapping

Source FieldDestination Field
namename
org_idorg_id
descriptiondescription
statusstatus
urlurl

NetworkDevice

Fields Mapping

Source FieldDestination Field
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
serial_numberserialnumber
location_idlocation_id
statusstatus
brand starbrand_id
model starmodel_id
asset_refasset_number
management_ipmanagementip
type starnetworkdevicetype_id
ios_version stariosversion_id
ramram

SNMP read/write, default_gateway and location_details are no longer part of the standard model.

Server

Fields Mapping

Source FieldDestination Field
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
serial_numberserialnumber
location_idlocation_id
statusstatus
brand starbrand_id
model starmodel_id
asset_refasset_number
management_ipmanagementip
os_family starosfamily_id
os_version starosversion_id
cpucpu
ramram

PC

Fields Mapping

Source FieldDestination Field
namename
org_idorg_id
importancebusiness_criticity
serial_numberserialnumber
statusstatus
brand starbrand_id
model starmodel_id
asset_refasset_number
os_family starosfamily_id
os_version starosversion_id
cpucpu
ramram

Printer

Fields Mapping

Source FieldDestination Field
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
serial_numberserialnumber
location_idlocation_id
statusstatus
brand starbrand_id
model starmodel_id
asset_refasset_number

MobilePhone

Fields Mapping

Source FieldDestination Field
namename
org_idorg_id
importancebusiness_criticity
serial_numberserialnumber
statusstatus
brand starbrand_id
model starmodel_id
asset_refasset_number
numberphonenumber
imeiimei
hw_pinhw_pin

ApplicationSolution

Fields Mapping

Source FieldDestination Field
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
statusstatus

BusinessProcess

Fields Mapping

Source FieldDestination Field
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
statusstatus

DBServer

Fields Mapping

Source FieldDestination Field
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
device_idsystem_id
software_idsoftware_id
licence_idsoftwarelicence_id
statusstatus

OtherSoftware

Fields Mapping

Source FieldDestination Field
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
device_idsystem_id
software_idsoftware_id
licence_idsoftwarelicence_id
statusstatus

DatabaseSchema

Fields Mapping

Source FieldDestination Field
namename
descriptiondescription
org_idorg_id
importancebusiness_criticity
db_server_instance_iddbserver_id

SoftwareLicence

Fields Mapping

Source FieldDestination Field
namename
descriptiondescription
org_idorg_id
importanceusage_limite
start_datestart_date
end_dateend_date
licence_keylicence_key
usage_limitusage_limit

lnkContactToFunctionalCI

Fields Mapping

Source FieldDestination Field
ci_idfunctionalci_id
contact_idcontact_id

No more role in 2.0 version

lnkDocumentToFunctionalCI

Fields Mapping

Source FieldDestination Field
ci_idfunctionalci_id
document_iddocument_id

Subnet

Fields Mapping

Source FieldDestination Field
descriptiondescription
org_idorg_id
ipip
ip_maskip_mask

PhysicalInterface

Fields Mapping

Source FieldDestination Field
namename
ip_addressipaddress
mac_addressmacaddress
serial_numbercomment
ip_maskipmask
speedspeed
device_idconnectableci_id

lnkConnectableCIToNetworkDevice

Fields Mapping

Source FieldDestination Field
source(if_dev)→device_idnetworkdevice_id
source(if_ci)→device_idconnectableci_id
source(if_dev)→namenetwork_port
source(if_ci)→namedevice_port
source(if_dev)→link_typeconnection_type

lnkApplicationSolutionToFunctionalCI

Fields Mapping

Source FieldDestination Field
solution_idapplicationsolution_id
ci_idfunctionalci_id

lnkApplicationSolutionToBusinessProcess

Fields Mapping

Source FieldDestination Field
solution_idapplicationsolution_id
process_idbusinessprocess_id

lnkPersonToTeam

Fields Mapping

Source FieldDestination Field
team_idteam_id
contact_idperson_id

Group

Fields Mapping

Source FieldDestination Field
namename
statusstatus
org_idorg_id
descriptiondescription
typetype
parent_idparent_id

lnkGroupToCI

Fields Mapping

Source FieldDestination Field
group_idgroup_id
ci_idci_id
reasonreason

CustomerContract

Fields Mapping

Source FieldDestination Field
namename
org_idorg_id
descriptiondescription
start_datestart_date
end_dateend_date
costcost
cost_currencycost_currency
billing_frequencybilling_frequency
cost_unitcost_unit
provider_idprovider_id

ProviderContract

Fields Mapping

Source FieldDestination Field
namename
org_idorg_id
descriptiondescription
start_datestart_date
end_dateend_date
costcost
cost_currencycost_currency
billing_frequencybilling_frequency
cost_unitcost_unit
provider_idprovider_id
slasla
coveragecoverage

lnkContactToContract

Fields Mapping

Source FieldDestination Field
contact_idcontact_id
contract_idcontract_id

lnkContractToDocument

Fields Mapping

Source FieldDestination Field
document_iddocument_id
contract_idcontract_id

Service

Fields Mapping

Source FieldDestination Field
namename
org_idorg_id
descriptiondescription
statusstatus

lnkDocumentToService

Fields Mapping

Source FieldDestination Field
document_iddocument_id
service_idservice_id

lnkContactToService

Fields Mapping

Source FieldDestination Field
contact_idcontact_id
service_idservice_id

Role is no more used in 2.0 data model

ServiceSubcategory

Fields Mapping

Source FieldDestination Field
namename
descriptiondescription
service_idservice_id
'incident'request_type
'production'status

SLA

Fields Mapping

Source FieldDestination Field
namename
1org_id

SLT

Fields Mapping

Source FieldDestination Field
namename
ticket_prioritypriority
metricmetric
valuevalue
value_unitunit

lnkSLAToSLT

Fields Mapping

Source FieldDestination Field
sla_idsla_id
slt_idslt_id

lnkCustomerContractToService

Fields Mapping

Source FieldDestination Field
source(lnk)→contract_idcustomercontract_id
source(sla)→service_idservice_id
source(lnk)→sla_idsla_id

lnkCustomerContractToProviderContract

Fields Mapping

Source FieldDestination Field
customer_contract_idcustomercontract_id
provider_contract_idprovidercontract_id

Problem

Fields Mapping

Source FieldDestination Field
refref
org_idorg_id
agent_idagent_id
titletitle
descriptiondescription
start_datestart_date
last_updatelast_update
close_dateclose_date
statusstatus
service_idservice_id
servicesubcategory_idservicesubcategory_id
productproduct
impactimpact
urgencyurgency
prioritypriority
related_change_idrelated_change_id
assignment_dateassignment_date
resolution_dateresolution_date

RoutineChange

Fields Mapping

Source FieldDestination Field
refref
org_idorg_id
agent_idagent_id
titletitle
descriptiondescription
start_datestart_date
end_dateend_date
last_updatelast_update
close_dateclose_date
statusstatus
reasonreason
requestor_idrequestor_id
creation_datecreation_date
impactimpact
supervisor_group_idsupervisor_group_id
supervisor_idsupervisor_id
manager_group_idmanager_group_id
manager_idmanager_id
outageoutage
fallbackfallback

NormalChange

Fields Mapping

Source FieldDestination Field
refref
org_idorg_id
agent_idagent_id
titletitle
descriptiondescription
start_datestart_date
end_dateend_date
last_updatelast_update
close_dateclose_date
statusstatus
reasonreason
requestor_idrequestor_id
creation_datecreation_date
impactimpact
supervisor_group_idsupervisor_group_id
supervisor_idsupervisor_id
manager_group_idmanager_group_id
manager_idmanager_id
outageoutage
fallbackfallback
approval_dateapproval_date
approval_commentapproval_comment
acceptance_dateacceptance_date
acceptance_commentacceptance_comment

EmergencyChange

Fields Mapping

Source FieldDestination Field
refref
org_idorg_id
agent_idagent_id
titletitle
descriptiondescription
start_datestart_date
end_dateend_date
last_updatelast_update
close_dateclose_date
statusstatus
reasonreason
requestor_idrequestor_id
creation_datecreation_date
impactimpact
supervisor_group_idsupervisor_group_id
supervisor_idsupervisor_id
manager_group_idmanager_group_id
manager_idmanager_id
outageoutage
fallbackfallback
approval_dateapproval_date
approval_commentapproval_comment

lnkContactToTicket

Fields Mapping

Source FieldDestination Field
rolerole
ticket_idticket_id
contact_idcontact_id

lnkFunctionalCIToTicket

Fields Mapping

Source FieldDestination Field
impactimpact
ticket_idticket_id
ci_idfunctionalci_id

KnownError

Fields Mapping

Source FieldDestination Field
namename
org_idorg_id
problem_idproblem_id
symptomsymptom
root_causeroot_cause
workaroundworkaround
solutionsolution
error_codeerror_code
domaindomain
vendorvendor
modelmodel
versionversion

lnkErrorToFunctionalCI

Fields Mapping

Source FieldDestination Field
error_iderror_id
infra_idfunctionalci_id
reasonreason

lnkDocumentToError

Fields Mapping

Source FieldDestination Field
error_iderror_id
doc_iddocument_id
link_typelink_type

UserRequest

Fields Mapping

Source FieldDestination Field
refref
org_idorg_id
caller_idcaller_id
agent_idagent_id
titletitle
descriptiondescription
start_datestart_date
last_updatelast_update
close_dateclose_date
statusstatus
request_typerequest_type
impactimpact
prioritypriority
urgencyurgency
service_idservice_id
servicesubcategory_idservicesubcategory_id
assignment_dateassignment_date
resolution_dateresolution_date
tto_escalation_deadlinetto_escalation_deadline
ttr_escalation_deadlinettr_escalation_deadline
resolution_coderesolution_code
solutionsolution
user_satisfactionuser_satisfaction
标签:
由 superadmin 在 2020/08/27, 15:59 创建
    

需要帮助?

如果您需要有关XWiki的帮助,可以联系:

深圳市艾拓先锋企业管理咨询有限公司