OIM 11g : How to export/import/delete Files from MDS

Most of Oracle Identity Manager (OIM) 11g configuration files are stored in database under Metadata Services (MDS). OIM 11g is covered in my book

This post is quick how to export/import files from/to MDS which is also covered in Oracle Documentation here

1. cd $ORACLE_HOME/server/bin

2. Open file weblogic.properties and update following

wls_servername=oim_server1     (This is name of OIM server, you can get server name from weblogic console)
application_name=oim                 ( oim if file is OOB file or OIMMetadata if this is custom file)
metadata_from_loc=/home/fusionapps/scripts/metadata    (Location of directory on file system that contains file which you wish to import; used during import process)
metadata_to_loc=/home/fusionapps/scripts/metadata  (Location of file on file system which you wish to import, used during import process)
metadata_files=/db/*  (Name of file which you wish to export/import like /db/oim-config.xml or user * which represents all files in that folder)

3. Set OIM_ORACLE_HOME to OIM ORACLE_HOME

export OIM_ORACLE_HOME=/oracle/apps/idam11115/mid/iam (replace value with OIM Oracle Home)

4.  Execute export/import command like
./weblogicExportMetadata.sh
or
./weblogicImportMetadata.sh

5. When prompted for username/password enter weblogic administrator username/password

6. When prompted for Server URL , enter Admin Server URL like t3://onlineAppsDBA.com:14000  (here onlineAppsDBA.com is server name on which OIM Server is running and 14000 is port of OIM Server) – [Thanks Sunny for pointing this out]

For any errors check log file under $DOMAIN_HOME/servers/<OIMSrverName>/logs

About the Author Atul Kumar

Oracle ACE, Author, Speaker and Founder of K21 Technologies & K21 Academy : Specialising in Design, Implement, and Trainings.

follow me on:

Leave a Comment:

13 comments
» Where are OAM details stored in OIM (account unlock, password reset) Online Apps DBA: One Stop Shop for Apps DBA’s says November 24, 2011

[…] OIM stores OAM details in MDS (database) under /db/oim-config.xml. You can export this file from MDS to file system using steps mentioned here […]

Reply
Sudhakar says December 18, 2011

Hi,

I am trying to export UserProfile using MDS utilities, Getting the following error.

Problem invoking WLST – Traceback (innermost last):
File “C:\Oracle\Middleware\Oracle_IDM1\server\bin\weblogicExportMetadata.py” line 22, in?
File “C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\mdsWLSTCommands.py”, Line 237, in exportMetadata
File “C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\mdsWLSTCommands.py”, Line 733, in executeAppRunTimeMBeanOperation
File “C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\mdsWLSTCommands.py”, Line 996, in saveStackAndRaiseException

WLSTException:MDS-01160: Expecting absolute document reference. Reference “dboim-config.xml” is a relative reference to the document. MDS-91009: Operation “exportMetadata” failure. Use dumpStack() to view the full stacktrac.e

Please help me on this.

I am using following in the weblogic.properties file

application_name=oim
metadata_from_loc = C:\Oracle\Middleware\server\metadata
metadata_to_loc = C:\Oracle\Middleware\server\metadata

metadata_files=\db\oim-config.cml

Using weblogicExportMetadata.bat (Windows machine)

Thanks
Sudhakar

Reply
Atul Kumar says December 18, 2011

@ Sudhakar,

For windows

metadata_to_loc : paths include // as file or directory separator.

metadata_files=/db/oim-config.xml

Reply
Sudhakar says December 18, 2011

Thanks Atul

That worked, But still I am unable to get the Exported file

I need RA_HRDATASOURCEGTC41.xml from the DB.

Specified this in weblogic.properties file

application_name=oim

metadata_from_loc=C:\Oracle\Middleware\Oracle_IDM1\server\metadata

metadata_to_loc=C:\Oracle\Middleware\logs

metadata_files=/db/RA_HRDATASOURCEGTC41.xml

Set OIM_ORACLE_HOME = C:\Oracle\Middleware\Oracle_IDM1

Reply
Sudhakar says December 18, 2011

worked finally

Thanks
Sudhakar

Reply
sunny says September 1, 2012

Hi Arun,

Thanks for sharing the information. I would like to make one clarification though: the server URL is not Admin Server URL, its OIM Server URL.

Thanks
Sunny

Reply
Atul Kumar says September 2, 2012

@ Sunny,
Thanks for pointing this out.

Reply
Nacho says May 9, 2013

Hi Atul,

I could not export /db/oim-config.xml until I changed application_name to OIMMetadata instead of oim. I think it should be corrected.

Thanks for all
Nacho

Reply
MadhuK says November 16, 2013

Hi Atul,

I have exported and imported the OIM metadata from our Sandbox env to the Test env. I have used exportMetadata and importMetadata methods from WLST env.

The import was successfull with the message saying 490 documents transferred successfully.

I have restarted the OIM server successfully but Iam unable to login into the sysadmin console using xelsysadm. I am getting the following error.

oracle.iam.platform.auth.exception.AuthenticationException: oracle.iam.platform.utils.userpreferences.UserDetailsException: An error occurred while getting group membership for the user 1.

Caused by: oracle.iam.platform.utils.userpreferences.UserDetailsException: An error occurred while getting group membership for the user 1.

Do we need to perform anything immediately after the import?

Pls help out here. Also let me know the best method to export and import Metadata across OIM environments.

Thanks,
MadhuK

Reply
zia says December 18, 2013

Hi Atul,

When i imported a xml file using deployment manager in xelsysadmin. when i added a file “an error occurred performing this operation “

Reply
    Atul Kumar says December 18, 2013

    @zia,
    Check errors in OIM log file to identify why import failed

    Reply
mohit says July 2, 2015

Hi,

I am trying to export metadata using exportMetadata() script. It worked in test but not on prod. I ran the same command on both the environment. I get the same error if I use the properties file and wlst() commands.

exportMetadata(application=’OIMMetadata’, server=’oim_server1′, toLocation=’/home/oracle/code’)

I get the following error:
Location changed to domainRuntime tree. This is a read-only tree with DomainMBean as the root.
For more help, use help(domainRuntime)

Executing operation: exportMetadata.

Traceback (innermost last):
File “”, line 1, in ?
File “/u01/oracle/Middleware/oracle_common/common/wlst/mdsWLSTCommands.py”, line 257, in exportMetadata
File “/u01/oracle/Middleware/oracle_common/common/wlst/mdsWLSTCommands.py”, line 801, in executeAppRuntimeMBeanOperation
File “/u01/oracle/Middleware/oracle_common/common/wlst/mdsWLSTCommands.py”, line 1079, in saveStackAndRaiseException
WLSTException: MDS-91009: Operation “exportMetadata” failure. Use dumpStack() to view the full stacktrace.

Any help would be appriciated.

Thanks,
Mohit.

Reply
Denmark Juance says May 4, 2016

Hi,

I would like to ask some help. We have accidentally imported a wrong folder structure to MDS so the MDS is currently looking like this:
-apps
-deployed-composites
-soa
-soa-infra_metadata

Is there any way I can delete the soa-infra_metadata directory in the MDS?

Thanks a lot.

Denmark

Reply
Add Your Reply

Not found