5 Replies Latest reply on Sep 5, 2013 8:25 AM by Mohammed Ali Khan

    Export all DepotObjects



      Product:  BMC BladeLogic Server Automation Console v8.0


      We are planning a migration for our Bladelogic console setup  --- from 8.0 to 8.0. I went through the BLCLI import/export commands contained in the 'BLCLI Help' manual and have come up with a solution but it requires passing the script the filepath to either the specific item I want to export OR filepath to the parent folder.


      Basically, If I want to export an item, say BLPackage, I can specify its full filepath and the name of the BLPackage and have it exported.


      If I have a folder called 'Releases' and under releases have folders with each folder containing a BLPackage, I have figured out method to export all the BLPackages under the parent folder (NSH script):


      # getting DB KEY for BLPackages under parent group

      blcli_execute DepotGroup groupNameToId /development/Releases

      blcli_storeenv parent_groupid

      blcli_execute DepotObject findAllByGroup ${parent_groupid} true

      blcli_execute DepotObject getDBKey

      blcli_execute Utility setTargetObject

      blcli_execute Utility listPrint

      blcli_storeenv db_keys


      # exporting each BLPackage under parent group

      for obj_db_key in ${db_keys}


        obj_db_key=`echo ${obj_db_key} | tr -d '[:cntrl:]'`


        blcli_execute DepotObject getNameByDBKey ${obj_db_key}

         blcli_storeenv obj_name

        blcli_execute ImportExport exportObject 28 ${obj_db_key} ${ENV[export_file_path]}/blpackage/${obj_name}



      However, I have the following two questions:


      -> Is there a way to simply export *all* items under 'Depot' category (or other category such as Jobs) instead of having to specify filepath?

      -> How can I get list of folders under a category such as 'Depot' or 'Jobs' and how can I get their subfolders (browse the directory tree)?