GLPI – SIM Card Data Migration from Plugin to Core
Beginning with GLPI version 0.83 a very useful plugin to record SIM card data was available.
The plugin was created by Walid Nouh and then updated by Anthony Piesset and Thierry Bugier Pineau, and was very convenient for keeping track of company SIM card data.
In addition to the specific data of the SIM like number, serial, PIN, PUK, size and so on, it was also possible to add relationships to connected assets (phone / PC / wireless router), documents and many other things.
This plugin was regularly updated and remained compatible until GLPI version 9.1.
Starting with GLPI 9.2 version, SIM cards were introduced as “components” in GLPI, and thus the plugin was no longer useful and therefore has not been updated any longer.
However, managing the SIM cards as “components” in GLPI was inconvenient, and Kaya84 created a fork that currently allows you to use the plugin up to GLPI 9.4.4
SIM cards management in GLPI version 9.5 (where it was always managed in “components”) has been improved and even if it is not as easy to use as in the Walid Nouh plugin, we might want to use it and trust that its usability will be further improved in the future.
For those who have updated GLPI to version 9.5, that plugin is no longer available. If you have a lot of data in the plugin unfortunately there is no migration script that transfers the SIM data from the plugin to the core.
However, don’t worry! It’s not necessary to re-enter them manually!
With a little familiarity with MySQL, you can easily migrate the data from the GLPI plugin to the core.
Follow the queries below and you will find your SIM card data transferred from the old plugin to the core. Most likely you will have to make some additions if you use other fields, but you will already have the bulk of the work done.
Query that inserts the SIMs in the new GLPI component table
insert into glpi_devicesimcards (id,designation,entities_id)
select id, name, entities_id, from glpi_plugin_simcard_simcards;
Query that inserts the comments of the SIMs in the new GLPI component table
update glpi_devicesimcards gd
join glpi_plugin_simcard_simcards gpss on gpss.id=gd.id
set gd.comment=gpss.comment;
Query that inserts the SIM data into the GLPI item-device relationship table
Query that inserts the data of SIMs not associated with a device in the GLPI item-device relationship table
insertinto glpi_items_devicesimcards (items_id, itemtype, devicesimcards_id, serial, otherserial, states_id, locations_id, pin, pin2, puk, puk2)
select '0', '', gpss.id, gpss.serial, gpss.otherserial, gpss.states_id, gpss.locations_id, gpss.pin, gpss.pin2, gpss.puk, gpss.puk2 from glpi_plugin_simcard_simcards gpss where gpss.id in (select gd.id from glpi_devicesimcards gd leftjoin glpi_items_devicesimcards gpid on gd.id=gpid.devicesimcards_id where devicesimcards_id is null);
Query that adds to the SIM those documents that were attached in the plugin
update glpi_documents_items set itemtype='DeviceSimcard' where itemtype='PluginSimcardSimcard';
Query that fixes the SIM history
update glpi_logs set itemtype='DeviceSimcard' where itemtype='PluginSimcardSimcard';
Gabriele Cecco
Technical Consultant at Würth IT Italy
I’m Gabriele Cecco, a consultant at Wuerth Phoenix with extensive experience in ITSM processes. Over the years, I’ve worked with various ITSM software tools, and since 2020, I’ve specialized in the Atlassian suite, earning certifications and helping many companies configure their Atlassian products.
In my free time, I enjoy listening to science and entertainment podcasts, watching movies and TV series, and traveling. I’m passionate about exploring the world, and when I’m not traveling abroad, I love spending weekends in South Tyrol with my wife and our minivan, Windy.
Author
Gabriele Cecco
I’m Gabriele Cecco, a consultant at Wuerth Phoenix with extensive experience in ITSM processes. Over the years, I’ve worked with various ITSM software tools, and since 2020, I’ve specialized in the Atlassian suite, earning certifications and helping many companies configure their Atlassian products.
In my free time, I enjoy listening to science and entertainment podcasts, watching movies and TV series, and traveling. I’m passionate about exploring the world, and when I’m not traveling abroad, I love spending weekends in South Tyrol with my wife and our minivan, Windy.
With NIS2, the focus moves toward how security is actually managed in day-to-day operations. An important part of NIS2 is operational discipline: Knowing which assets exist, who's responsible for them, how incidents are handled, how changes are controlled, and whether Read More
Use Case Anyone who manages GLPI knows the situation: assets get assigned to users, but there is never a formal acknowledgement that the user is aware of what was handed to them and that the data is accurate. No signature, Read More
TL;DR: In GLPI, access permissions for assets have traditionally been tied mainly to entities. That works well in clean structures, but in reality, responsibility, ownership, and organizational hierarchy do not always follow the same lines. With GLPI 11, group-based permissions Read More
Bug Fix We updated the version of GLPI in order to fix some relevant vulnerabilities. List of updated packages The following packages have been updated for NetEye 4.45: glpi, glpi-autosetup, glpi-configurator, glpi-neteye-config to version 10.0.22_neteye1.17.5-1.
Every IT department has it: the mythical stockroom with all those small parts, cables, plugs, adapters… and mice everywhere (each one with a long cable 😉). Once perfectly organized, it’s now the place where “things we might need someday” go Read More