Programming Guides › Programming Guide for Perl › Policy Management Operations › Policy Store Object Migration › Export Realm Objects
Export Realm Objects
Some points to note about the exporting realm objects:
- A data manager object $datamgr is created for the export operation.
- Realm objects in the domain Acme North Domain are being exported. All realms are exported except for the HR realm.
- Object information is exported to the file Data.smdif. The file will be written to the same directory as the export script. Any existing Data.smdif file in that directory will be completely overwritten.
- Configuration information is exported into the file NorthEnv.cfg. This configuration information is specific to the computer at the North site. It will not be used when the realms are imported at the South site.
- Neither of the default export flags has been changed:
- Data will be exported in encrypted text. You can override the default with ClearText(1).
- The specified objects and their dependencies are exported. You can export just the current objects with IncludeDependencies(0).
Example:
use Netegrity::PolicyMgtAPI;
$policyapi = Netegrity::PolicyMgtAPI‑>New();
$session = $policyapi‑>CreateSession("adminid", "adminpwd");
$datamgr=$session‑>CreateDataManager("Data.smdif","NorthEnv.cfg",1);
die "FATAL: Data manager creation failed.\n" unless($datamgr!=undef);
print "\nData manager creation was successful.\n";
$domain = $session‑>GetDomain("Acme North Domain");
@realms=$domain‑>GetAllRealms();
foreach $realm(@realms) {
if($realm‑>Name ne "HR") {
$result=$datamgr‑>Export($realm);
print "Export of " . $realm‑>Name(). " realm. Status: " .
$result . "\n";
}
}