Move child table field data to parent table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-11-2019 09:56 AM
Hi All,
We have 'end of life' field in cmdb_ci_hardware table and it has 5500 records which are having that field filled .I want to move this field to cmdb_ci without losing data.So that I can use that field under Asset-CI mapping table .Please suggest me .
Also how can i confirm ,is there any script or some thing is using this field .So that it should not impact anything .I have checked BRs,Client scripts and SIs,There is nothing related to this field.
Please let me know if you need any other information.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-11-2019 08:20 PM
Hi all,
Can anyone please assist me on this ?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-11-2019 09:12 PM
Hi Abhishek,
My first question would be why do you want it? The best practice from ServiceNow is to keep data in their respective tables/Classes.
If you want to do it you will have to first of create 'end of life' field on cmdb_ci table and then change the 'Class' of all records to 'Configuration Item'. Also, then verify the 'Class' field of asset record is changed from alm_hardware to alm_asset. Start off by doing it for couple of records in your dev environment from the front-end. After that you can write a Fix Script.
Let me know in case of any issues.
Please mark this comment as Correct Answer/Helpful if it helped you.
Cheers,
Hardit Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-11-2019 11:51 PM
Hi Hardit ,
Thanks for your response .
I want to promote 'end of life' field from cmdb_ci_hardware to cmdb_ci because i want to use end of life field under 'Asset-CI field mapping' table to sync 'end of life' field for CMDB and Asset.As under 'Asset-CI field mapping' table we get fields in drop down from alm_asset and cmdb_ci.
I am not sure ,why we would need to change to class for those Configuration Items because if 'end of life' field will be in cmdb_ci table then it would come automatically in 'cmdb_ci_hardware'table as its child table.
Can't we create one staging field to store end of life field data in cmdb_ci_hardware.and we can delete that field from cmdb_ci_hardware table and create new one in cmdb_ci table .After this we can move data from staging field to end of life field for those records.
If it is the possible way ,Can you help me with Background script to get this .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā06-12-2019 02:05 AM
Please let me know if you need any other information.
Thanks.