Exporting LDAP Data

This is an example of commands to export LDAP data from 12.1.3.

Before exporting LDAP data, perform the following on the source environment, 12.1.3

ssh -i opc_rsa opc@source_admin_host_ip
sudo -su oracle
cd /u01/
cd /app/oracle/middleware/oracle_common/common/bin/
./wlst.sh
connect('weblogic','welcome1','t3s://<source_admin_host_ip>:<admin_port>')
currentDomainName=cmo.getName()
  1. Export users and groups.
    cd('serverConfig:/SecurityConfiguration/' + currentDomainName +
    '/Realms/myrealm/AuthenticationProviders/DefaultAuthenticator')
    cmo.exportData('DefaultAtn', 'filename', Properties())

    Example: cmo.exportData('DefaultAtn','/tmp/ldapdata/DefaultAuthenticator.dat', Properties())

  2. Export security roles.
    cd('serverConfig:/SecurityConfiguration/' + currentDomainName +
    '/Realms/myrealm/RoleMappers/XACMLRoleMapper')
    cmo.exportData('XACML','filename', Properties())
  3. Export credential mapper.
    cd('serverConfig:/SecurityConfiguration/' + currentDomainName +
    '/Realms/myrealm/CredentialMappers/DefaultCredentialMapper')
    cmo.exportData('DefaultCreds','filename', Properties())
  4. Export XACML Authorizer.
    cd('serverConfig:/SecurityConfiguration/' + currentDomainName +
    '/Realms/myrealm/Authorizers/XACMLAuthorizer')
    cmo.exportData('XACML','filename', Properties())

    Where filename is the file path where data needs to be exported.

  5. Copy exported file to local box.

    Create a directory where you can copy the exported data.

    scp DefaultAuthenticator.dat <username:source_host_ip>:/<local_export_dir_path>
    Example:
    scp DefaultAuthenticator.dat myuser@myhost.us.oracle.com:/scratch/exp_dat
    
    scp DefaultCredentialMapper.dat <username:source_host_ip>:/<local_export_dir_path>
    scp XACMLAuthorizer.dat <username:source_host_ip>:/<local_export_dir_path>
    
    scp XACMLRoleMapper.dat <username:source_host_ip>:/<local_export_dir_path>
  6. Copy LDAP data from the 12.1.3 host to the 12.2.1.2 host.

    Create a folder on the target environment.

    Go to the target directory folder where exported files should be copied ('.' represents current directory).

    scp <username:TARGET_SOACS_HOST_IP>:/<local_export_dir>/DefaultAuthenticator.dat
    Example:
    scp myuser@myhost.us.oracle.com:/scratch/export_data/DefaultAuthenticator.dat
    
    scp <username:TARGET_SOACS_HOST_IP>:/<local_export_dir>/DefaultCredentialMapper.dat
    scp <username:TARGET_SOACS_HOST_IP>:/<local_export_dir>/XACMLAuthorizer.dat
    scp <username:TARGET_SOACS_HOST_IP>:/<local_export_dir>/XACMLRoleMapper.dat