What I would do: rename the class in the XML.
Then DON'T run the iTop setup just yet, but manually change the name of the table 'domain' to 'newclassname'.
Then run iTop setup.
Try this in a test environment first. I'm also unsure what the consequences may be for any history on the objects.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Be careful with class renaming. If you change the id in the /class node, you will have to make sure there is no data related to the class name in the database.
For example if you class is derivated from another (eg. like UserRequest is from Ticket), you will have to migrate the finalclass field of the parent class table in the DB.
From what I see in the snippet you pasted, seems like your class derivates from the License class. So check the license table in your DB, you might have Domain in the finalclass.
Same goes with the attachments, if you have enable them on the class, you will have to change the value in the itemclass field.
Finally, changing the table name of the Domain class is optional for the renaming itself but might be necessary to avoid collision with the IPAM module.
Hope it helps :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Someone in my company created an extension with a sub class "Domain"
I would like to know how rename it because this cause me some trouble to install the IPAM extension because it contain a class "Domain" too ....
Thanks in advance for your answers,
Sebastien
I doubt there's an official way.
What I would do: rename the class in the XML.
Then DON'T run the iTop setup just yet, but manually change the name of the table 'domain' to 'newclassname'.
Then run iTop setup.
Try this in a test environment first. I'm also unsure what the consequences may be for any history on the objects.
https://www.itophub.io/wiki/page?id=2_5_0%3Acustomization%3Axml_reference
Rename a node
Another attribute is _rename_from. Use it to specify that the item (e.g. a class field) is in fact an existing item renamed from _rename_from to id.
Hi Sebastien,
Be careful with class renaming. If you change the id in the /class node, you will have to make sure there is no data related to the class name in the database.
For example if you class is derivated from another (eg. like UserRequest is from Ticket), you will have to migrate the finalclass field of the parent class table in the DB.
From what I see in the snippet you pasted, seems like your class derivates from the License class. So check the license table in your DB, you might have Domain in the finalclass.
Same goes with the attachments, if you have enable them on the class, you will have to change the value in the itemclass field.
Finally, changing the table name of the Domain class is optional for the renaming itself but might be necessary to avoid collision with the IPAM module.
Hope it helps :)
Hello,
I did it yesterday and works well !
I rename table and final class, then modify the extension.
Thanks all !
Glad it helped! :)