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 2024-09-24 08:07:02

d_inoue
Member
Registered: 2023-04-04
Posts: 3

To move root entity to sub entity

Hello,

I use GLPI as root entity only.
Now, I have to make another entity which is not included current one
but completely separated old (current) one.

It means...
<Now>
[root] = [current]

<To be>
[root]
- [current]
- [new one]

So I searched this forum,
I found a solution, moving assets in current root entitiy to new sub-entity.

But I have too many assets and also tickets and users, etc.

I want to do that by changing records with SQL query on the GLPI database table, glpi_entities.
Please help me to show sample query.

Thank you.

Offline

#2 2024-09-28 10:01:31

InvisibleJim
Member
Registered: 2023-11-26
Posts: 14

Re: To move root entity to sub entity

Probably a safer way than manipulating the database directly would be to use the REST API update Items

***https://github.com/ramylson/glpi/blob/master/glpi/apirest.md#update-items***

Offline

#3 2024-09-30 04:48:14

d_inoue
Member
Registered: 2023-04-04
Posts: 3

Re: To move root entity to sub entity

InvisibleJim, thank you for your reply.

But is it possible changing the root entity itself to sub one?
As I wrote, I have too many items and tickets etc. under the current root entity,
so, I don't want to change the items but the root entity itself.

Offline

#4 2024-09-30 11:54:03

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,809
Website

Re: To move root entity to sub entity

No, you cannot create a new root entity and move the original as a child entity. If you try to force it by changing things directly in the database, it will cause issues.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#5 2024-10-01 03:51:21

d_inoue
Member
Registered: 2023-04-04
Posts: 3

Re: To move root entity to sub entity

cconard96, Thank you.

So is there any solution to move all of the things -- items, tickets, dropdowns and whatever I've not recognize -- in the root entity to new child entity?
I think changing entity hierarchy is easier...

Last edited by d_inoue (2024-10-02 07:09:01)

Offline

#6 2024-10-03 15:10:58

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,809
Website

Re: To move root entity to sub entity

You can add items to the entity transfer list in bulk using massive actions (Select all from search results, click actions button, select Add to transfer list).
It is still a manual process though.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#7 2024-10-11 08:39:25

Sico31
Member
Registered: 2018-09-24
Posts: 605

Re: To move root entity to sub entity

Hi, i will have the same problem and try to move in my test instance.
I have this
ROOT
  - E1
  - E2
  - E3

and want
NEW ROOT
  |- old ROOT
  |     |- E1
  |     |- E2
  |-E3

So i create a new sub entity and indicates it as father for E1 and E2
I rename the root
In database, i use a script thaht change the entity_id present in many tables to move them from root (id 0) to new root (id 5)
This had works fine. I just too manage some few users and group to be in the root entity (SA user, 1-2 techniciens group, few forms)


Manger un castor, c'est sauver un arbre.
Quand on est mort, on ne sait pas qu'on est mort ; c'est pour les autres que c'est difficile. Quand on est con, c'est pareil !

Offline

Board footer

Powered by FluxBB