6 Replies Latest reply on Feb 27, 2012 12:39 AM by Abhijit Valvekar

    dataset export/import

      Is there a published way to accomplish ...


      - export/backup a dataset;

      - import a dataset;

      - (delete existing and) import a dataset as a way to restore it from a previous backup;

      - copy one dataset from another;

      - (use a combination of above as a mechanism to) move islands of data from one environment to other -- mainly in the context of staging/testing or possibly even as part of deployment of critical changes.


      BTW, when I say 'dataset' here -- it includes the data set record, as well as all the data in all (or, at least a given set of) classes & relationships. All of this as a self-contained logical unit. The key there is to ensure that the relationships still are to be maintained properly after combinations of the above tasks (for example, export out a data set from one environment and then restore  this exported content on to a different environment). So trivially altering or generating new instanceids won't work.


      Any thoughts, ideas, or pointers to previous work or proven ways that solve this issue -- are all greatly appreciated.




        • 1. dataset export/import
          Amey Bagwe

          there are 2 methods of moving CI data between environments


          • take a entire db backup and save it a dump / backup file. Restore the same db backup / dump file into another environment. But the versions (remedy binaries) in both environments should match. Since you want to preserve all the instance ids and recon ids, I would suggest you use this approach if you have a db administrator or sufficient db level knowledge.


          • use the command line utility cmdbdriver to export CI data for classes / datasets to a xml file. refer to the BMC Atrium CMDB Adminsitrator's guide. Import the CI data into another environment using cmdbdriver -> impdt command ->xml file


          cmdbdriver utility has the commands to clean up datasets (CIs in a datasets) along with the related CIs.There are commands to clean up residual / orphan relationship CIs if any.



          • 2. dataset export/import

            Thanks for the response.


            First option is no go for us, because what I am really looking for a way to copy/move dataset level isolated data between environments. Not as a backup/restore of entire DB.


            >>cmdbdriver utility has the commands to clean up datasets (CIs in a datasets) along with the related CIs.There are commands to clean up residual / orphan relationship CIs if any.<<


            Can you elaborate what these commands specifically are? Or any pointer to docs.


            Indeed I have gone the route of wrappinig cmdbdriver scripts that do export data from one, and, import into another. However the challenge is how do you get these new CIs & relationships in place on the target side without breaking the previously established relationships in the source dataset.



            • 3. Re: dataset export/import

              Another two options are to use the migrater tool. The new migrater tool (I am not sure what version this changed in) understands CMDB objects and can migrate the CIs from one system to another.


              If you a comfortable with Java,C/C++, or web services you can always query the objects using one of the CMDB APIs and then insert them into the destination.


              On both of these the key is to exoprt the CI objects first then the relationships.

              • 4. Re: dataset export/import
                Manish Patel

                Hi Appajee,

                .<< Can you elaborate what these commands specifically are? Or any pointer to docs

                You can refer CMDBDiag utility which does exactly what you’re looking.




                1 of 1 people found this helpful
                • 5. dataset export/import
                  Amey Bagwe

                  Apologies, not cmdbdriver, but cmdbdiag utility can be used to clean up datasets and relationships. Login to cmdbdiag and you will get step by step instructions and menu choices.

                  • 6. dataset export/import

                    #1 Export Data and Backup -


                    To Back your existing data you can use CMDB Driver Command - xexpdt


                    xexpdt - This will back up your entire data(CI's and Relationship) in chunk.


                    e.g. In below I have taken the data back for BMC.SAMPLE dataset from BMC_BaseElement Class. If you would like to export data for only few class then you can set the "Export instance data from all classes?" to F.


                    Please provide the file name as i have given Test1.XML(The file will create at CMDB Driver Location or you can specify absolute path). If you have very large kind of data then number of xml file gets generated at provided location.

                    Command: expdt
                    EXPORT DATA
                    Class Name
                       Namespace (): BMC.CORE
                       Class name (): BMC_BaseElement
                       Dataset ID (): BMC.SAMPLE
                    Qualification string:
                       Number of Attributes (0):
                    Number of sort attributes (0):
                    First Retrieve (0):
                    Maximum number of entries to retrieve (500):
                    Filename for exported data: test.xml

                       CMDBExportData  results
                    ReturnCode:  OK
                    Status List : 0 items

                    Command: xexpdt
                    XEXPORT DATA
                    Export instance data from all classes? (F): T
                    Dataset ID (): BMC.SAMPLE
                    Filename for exported data: test1.xml



                    # 2 Cleaning the data -


                    Use cmdbdiag (@ Location <<AtriumCore Home>>\cmdb\sdk64\bin) to cleanup the data.


                    e.g.  from the cmdbdiag you can choose the 2 option for cleaning the data and to clean dtaset for all datasets choos "y" as shown below -

                    Main Menu

                       1. Data Integrity Checker
                       2. CI and Relationship Correction Tool
                       3. Quit

                       Enter your choice --> 2

                    CI and Relationship Correction Tool Submenu

                       1. Reset Reconciliation Identities
                       2. Clean up Dataset
                       3. Correct Relationships
                       4. Delete Orphan Relationships
                       5. Remove Cardinality Violations
                       6. Clean up Classes
                       7. Fix Orphaned Weak members
                       8. Delete Orphaned Weak members
                       9. Main Menu

                       Enter your choice --> 2

                    CLEANING UP DATASET

                       All datasets [y, n] (n) : y

                    The following classes will be affected:


                    #3 Importing dataset -


                    impdt - use this command to import the data (shown below)


                    Command: impdt
                    IMPORT INSTANCE DATA
                    Handle duplicate Instance Ids:
                      (Error/New ID for Dup/Merge/New ID for All) (1-4) (1): 2
                    Filename containing import data: test1.xml_100_0

                       CMDBImportData  results
                    ReturnCode:  OK
                    Status List : 0 items
                    Total items Processed             :  23
                    Items Imported successfully       :  23
                    Items for which Import failed     :  0


                    provide the xml file name(we have already backed up the data by using xmpdt).

                    1 of 1 people found this helpful