Hi AnandBadiger,
Here are some quick answers to your questions:
1) You can export into a folder structure using GMU. The command is:
./GatewayMigrationUtility.sh migrateOut --folderName "myFolder" --format directory
Note you will still need to add other connection parameters.
2) You can override some of the contexts of entities by using templating. Using the template command:
./GatewayMigrationUtility.sh template -b myBundle
This will create a template properties file where you can override values of entities.
3) The best way to get examples for restman is to use the "/template" endpoint also look at the documentation as: "/restman/1.0/doc/". For example "/restman/1.0/policies/template" returns:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<l7:Item xmlns:l7="http://ns.l7tech.com/2010/04/gateway-management">
<l7:Name>POLICY Template</l7:Name>
<l7:Type>POLICY</l7:Type>
<l7:TimeStamp>2016-03-13T13:35:17.703-07:00</l7:TimeStamp>
<l7:Link rel="self" uri="https://192.168.171.129:8443/restman/1.0/policies/template"/>
<l7:Link rel="list" uri="https://192.168.171.129:8443/restman/1.0/policies"/>
<l7:Resource>
<l7:Policy guid="guid-8757cdae-d1ad-4ad5-bc08-b16b2d370759">
<l7:PolicyDetail folderId="FolderID" guid="guid-8757cdae-d1ad-4ad5-bc08-b16b2d370759">
<l7:Name>Policy Name</l7:Name>
<l7:PolicyType>Include</l7:PolicyType>
<l7:Properties>
<l7:Property key="PropertyKey">
<l7:StringValue>PropertyValue</l7:StringValue>
</l7:Property>
</l7:Properties>
</l7:PolicyDetail>
<l7:Resources>
<l7:ResourceSet tag="policy">
<l7:Resource type="policy"><?xml version="1.0" encoding="UTF-8"?>
<exp:Export Version="3.0"
xmlns:L7p="http://www.layer7tech.com/ws/policy"
xmlns:exp="http://www.layer7tech.com/ws/policy/export" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<exp:References/>
<wsp:Policy xmlns:L7p="http://www.layer7tech.com/ws/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
<wsp:All wsp:Usage="Required">
</wsp:All>
</wsp:Policy>
</exp:Export>
</l7:Resource>
</l7:ResourceSet>
</l7:Resources>
</l7:Policy>
</l7:Resource>
</l7:Item>
Another good way to see examples of restman requests is to export or get an existing entity. In nearly all cases you can just import that same entity.
4) You can get both the wald and the schema from the "/restman/1.0/rest.wadl" and "/restman/1.0/gateway-management.xsd" endpoints.
5) By default restman does not export passwords or private keys. When it does export them it exports them in an encrypted format.