You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2020-11-25 17:16:56

antoine0394
Member
Registered: 2020-11-24
Posts: 29

Export all fields from entities

Hi,

I have multiple GLPI websites and I want to merge them into one to simplify ticket management. It seems very complicated and I am struggling to find how to merge properly databases. An element that complicates the process is that a user can be in one or more existing databases.

I think it could be okay if I can export all columns from elements like Computer, License, ... and then use the CSV exported file with DataInjection plugin.

The problem is that I don't find an easy way how to export element with all tables...

I would appreciate some help or tips,

Thanks,
Antoine

Offline

#2 2020-11-26 20:28:46

fabianoantunes
Member
Registered: 2013-05-29
Posts: 16

Re: Export all fields from entities

Antoine,

It seems, IMHO, that you need assistance from a DBA.  Merging databases is no simple task.  It gets even more complicated in the case you describe, as you have duplicate data on several databases.  Depending on the size of these databases, they can become really time-consuming if you intend to do it manually.

That said, if you intend to do it yourself, here are my 2 cents.

1) Make sure you have proper backups of all of the environments prior to starting - no, GLPI build-in backup won't cut it.
1.1) Backup databases with proper database backup tools; for instance, if you're using mysql, use mysqldump for the task.
1.2) Backup your web directory files.
2) Make sure you understand and map the relationships of the database tables.
2.1) Map the keys of each table, check what are the duplicates and decide how to act on them (merge into one of them; merge into a new one, whatever you decide on each case).

GLPI Developer Documentation of Database Model can provide you with a hint about these relationships. Notice this is not a complete database model.  You should check your current and actual databases.

I know the above seems discouraging and it, actually, is.  As I informed in the beginning of this post, merging databases is no simple task, de-duplicating data from databases is not quite as simple as it might seem, due to tables relationships.
If you're not used to manipulating database records from a database console, I'd strongly advise you to - definitely - hire a DBA to perform the merge.

I'm truly sorry if this is not the answer you expected, but it is the truth and might help you avoid data loss during the migration/merging process.

Last edited by fabianoantunes (2020-11-26 20:30:22)

Offline

#3 2020-11-27 01:10:33

LaDenrée
HELPER
Registered: 2012-11-19
Posts: 6,146

Re: Export all fields from entities

Whatever the solutions you choose, it wont't be easy

You also can use API to get computers in source database then for each computer get associated element and then check if these elements/computer exist in target database and create objects with API.

or use API to GET computers then for each computer use API to GET elements then put into a csv file and use datainjection plugin


Trouver la panne avant de réparer...
GLPI10.0.10 (ubuntu 22.04 PHP8.1  Mariadb10.6 ) plugins : comportements 2.7.2 reports 1.16.0 formcreator 2.13.8, datainjection 2.13.4 fields 1.21.6

Offline

#4 2020-11-27 10:35:58

mklimasz
Member
Registered: 2017-12-14
Posts: 82

Re: Export all fields from entities

I fully agree with Colleagues above... I've done this exercise once (multiple GLPI instances that needed consolidation) and the only way that worked was actually a hard manual labor...

This is what worked for us (no cutting corners with sql, because the DB structure is simply too complex to deal with it):
1. Backup, backup, backup - above all: have means of restoring the starting point, should anything go wrong... Data Injection plugin is pretty powerful...and dangerous, too.
2. Create target Entities structure in the "master" instance
3. Make coherent user structure (LDAP was a solution there, as it would ensure they're all synced only once); Attempts of Data Injections on "Users" created overlapping artefacts so we gave up on those; if You'd like to keep the Users in their Entities - and have any means of control over this complex structure - think about default Authorization assignment rules up front (otherwise all the Users would land in root Entities structure and You'd need to move them manually into their targets)
4. Start exporting contents from source systems (create a "super-view" that lists everything about selected Assets (e.g.: Computers) - export "all to csv" - check the data and decide what would work best as uniqueness key for each category (computers, phones, network devices - #SN worked best for us) - load to specific category using data injection plugin - test thoroughly for any errors before jumping to another category or upload)

Hope this would give You some useful hint on how to proceed...

Offline

#5 2020-12-01 11:14:16

antoine0394
Member
Registered: 2020-11-24
Posts: 29

Re: Export all fields from entities

Hey,

Thanks for you help.

Well I think I'll ask my collegues some help to do this tongue

have a good day,
A.

Offline

Board footer

Powered by FluxBB