Export EEM polices using safex (Command line)

book

Article ID: 49572

calendar_today

Updated On:

Products

CA Workload Automation AE - Business Agents (AutoSys) CA Workload Automation AE - Scheduler (AutoSys) CA Workload Automation Agent CA Process Automation Base CA Service Catalog

Issue/Introduction

In order to export EEM policies and settings using safex, you must create a file with commands that tells safex to export.
Once the export command file is created you will then use safex with this command file to generate an XML file with your data that can then saved as a backup point, or can be imported to another EEM instance.

Environment

Release: Embedded Entitlements Manager (EEM) 12.x
Component: ATSEEM ETEIAM

Resolution

Create a .txt file, for instance, export.txt in the /EmbeddedEntitlementsManager/bin directory.

The contents of this file will be:

<Safex>
<Attach label="application_name_registered_with_EEM"/>

<!-- You can control the data to be exported by specifying the Yes(Y) or No(N). If you store the global users and global groups in the CA internal user store, all the objects are exported.

You can override the maximum number of items that are returned by the backend server. The default is 2000. To change the maximum number of items to return, include the maxsearchsize="Value" -->

<Export file="path of XML file to be exported" globalfolders="y" globalusergroups="y" globalusers="y" globalsettings="y" folders="y" usergroups="y" users="y" calendars="y" policies="y" appobjects="y"/>

<Detach/>
</Safex>

To break each section down:

Section 1

<Attach label="application_name_registered_with_EEM"/>

The application name must be identical to what is stored in EEM. 
For instance, if you are exporting Service Catalog, then this line will look like:

<Attach label="Service Catalog"/>

Spaces are valid in the application name. You can verify your application name by logging into EEM as EiamAdmin and selecting the Configure tab. This will show you all of your registered applications.
Select the application on the left, and from the right pane you can copy what is listed as the "Name".
If you are unable to log into EEM as EiamAdmin, you will not be able to export your application.
If you don't have immediate access to the GUI, you can verify the registered applications by looking in the /iTechnolgoy/ folder (IGW_PATH). In this folder are cache files for each of the registered applications. The name of the file will be :  registered_application_name.25.cache or registered_application_name.26.cache
For instance: ServiceCatalog.25.cache  or ITPAM 4.3 SP05.26.cache

There are cache files for each registered application, as well as for the PozAdmin. Copy the name only, not the number or file extension.

Section 2

<!-- You can control the data to be exported by specifying the Yes(Y) or No(N). If you store the global users and global groups in the CA internal user store, all the objects are exported.

You can override the maximum number of items that are returned by the backend server. The default is 2000. To change the maximum number of items to return, include the maxsearchsize="Value" -->

This is commented and is informational only and actually not required to be in the file at all.
If your EEM is connected to an external LDAP directory as the user store, you must change all "global" parameters to "n"
Global parameters are only valid if you use the internal user store.

If you have 4000 users, groups and policies, you will want to add   maxsearchsize="8000" just to be sure that everything is exported.

Section 3

<Export file="path of XML file to be exported" globalfolders="y" globalusergroups="y" globalusers="y" globalsettings="y" folders="y" usergroups="y" users="y" calendars="y" policies="y" appobjects="y"/>

The export file is going to be the XML file that is created using this process, for example, "AutoSys_export.xml"  or "/tmp/AutoSys_export.xml"  or "C:\temp\AutoSys_export.xml"

If you do not provide a path, but just the file name (first example) the XML file will be created in the /EmbeddedEntitlementsManager/bin folder where the safex utility is located. This is perfectly fine, you can specify the file creation where ever you require it as long as you have write privileges to the location.

So here is a full sample file which is for an EEM using an Active Directory external user store and 2500 objects to be exported:

<Safex>
<Attach label="ITPAM 4.3 SP05"/>

<Export file="ITPAM_Export.xml" globalfolders="n" globalusergroups="n" globalusers="n" globalsettings="n" folders="y" usergroups="y" users="y" calendars="y" policies="y" appobjects="y" maxsearch="4000"/>

<Detach/>
</Safex>

To run this, you must be in the /EmbeddedEntitlementsManager/bin folder where the safex utility is located.
Issue the following command using the password for your EiamAdmin account:

safex -h localhost -u EiamAdmin -p <eiamadmin_password> -f export.txt

This will now create the file ITPAM_Export.xml in this same folder.

You can now save this file as a backup to import in case of an emergency or move this file to a new EEM server as a backup or a new installation.

To import the file you will run the same safex command, this time using the ITPAM_Export.xml as the filename as:

safex -h localhost -u EiamAdmin -p <eiamadmin_password> -f ITPAM_Export.xml