Sun Java System Access Manager 7.1 Administration Guide

Exporting Policies to Other Access Manager instances

Access Manager allows you to export policies using the amadmin command line tool This is useful when you wish to move many existing policies to another Access Manager instance, or if you wish to inspect changes that you have made to existing policies in batch mode. To export policies, use the amadmin command line utility to export the specified policies to a file. The syntax is:

amamdin - u username —w password —ofilename output_file.xml —t policy_data_file.xml

You can use the wildcard (*) in the policy name to match any string of characters.

The following is an example of the policy_data_file.xml:


<?xml version="1.0" encoding="ISO-8859-1"?>

<!--
    Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved
    Use is subject to license terms.
-->

<!DOCTYPE Requests
    PUBLIC "-//iPlanet//Sun Java System Access Manager 6.2 Admin CLI DTD//EN"
    "/opt/SUNWam/dtd/amAdmin.dtd"
>>

<!--  CREATE REQUESTS -->

<!-- to export to file use option -ofilename fileName -->

<Requests>    

<RealmRequests >    
<RealmGetPolicies realm="/" >
<AttributeValuePair>
<Attribute name="policyName"/>
<Value>p*</Value>
</AttributeValuePair>
</RealmGetPolicies>
</RealmRequests>

<RealmRequests >    
<RealmGetPolicies realm="/" >
<AttributeValuePair>
<Attribute name="policyName"/>
<Value>g10</Value>
<Value>g11</Value>
</AttributeValuePair>
</RealmGetPolicies>

</RealmRequests>
<RealmRequests >    
<RealmGetPolicies realm="/realm1" >
<AttributeValuePair>
<Attribute name="policyName"/>
<Value>*</Value>
</AttributeValuePair>
</RealmGetPolicies>
</RealmRequests>

</Requests>

The policies are exported to the Output_file.xml file. You can now make any changes to policy definitions contained in the file. You must alter the output file so that it is compatible with the amadmin command utility before importing the policies to another Access Manager instance. For instructions on how to import the policies, including an example of an amadmin-compatible policy data file, see To Create Policies with amadmin