In Weblogic for exporting metadat we use various command like
-> importMetaData – Imports metadata for an application.
-> exportMetaData – Exports metadata for an application.
-> deleteMetaData – Deletes the metadata in the application repository.
-> purgeMetaData – Purge metadata.
-> deleteMetadata – Deletes the selected documents from the application repository. When this command is run against repositories that support versioning (that is, database-based repositories), delete is logical and marks the tip version (the latest version) of the selected documents as “deleted” in the MDS repository partition.
example – wls:/weblogic/serverConfig> deleteMetadata(application=’mdsapp’,server=’server1′, docs=’/mypackage/*’)
-> exportMetadata -Exports application metadata. Use this command and the importMetadata command to transfer application metadata from one server location (for example, testing) to another server location (for example, production).
example – wls:/weblogic/serverConfig> exportMetadata(application=’mdsapp’,server=’server1′,toLocation=’/tmp/myrepos’,docs=’/**’)
-> importMetadata– Imports application metadata. Use the exportMetadata command and this command to transfer application metadata from one server location (for example, testing) to another server location (for example, production).
example – wls:/weblogic/serverConfig> importMetadata(application=’mdsapp’, server=’server1′,fromLocation=’/tmp/myrepos’,docs=”/**”)
-> purgeMetadata– Purges the older (non-tip) versions of unlabeled documents from the application’s repository. All unlabeled documents will be purged if they are expired, based on Time-To-Live (the olderThan argument). This command is applicable only for repositories that support versioning, that is, database-based repositories.
example – wls:/weblogic/serverConfig> purgeMetadata(‘mdsapp’, ‘server1’, 10)
update metadata in webcenter-config.xml –
Now Lets take an example of changing an metadata for webcenter application. So first we export in some temprary location then we make some changes.Then again we import from temp location to specified location.
-> Go to Middleware home/WebCenter Installation directory/common/bin and run wlst.sh (unix) or wlst.cmd(windows)
-> connect(‘weblogic’,’weblogic1′,’locahost:7001′) or give secure files path connect(userConfigFile=’/oracle/config.secure’, userKeyFile=’/oracle/key.secure’, url=’localhost:7001′)
see how to generate secure file
Then export the current configuration by running the following command in WLST command line. Set the toLocation to some “temporary location”.
->exportMetadata (application=’webcenter’, server=’WC_Spaces’, toLocation=’/tmp/Metadata’, docs=’/oracle/webcenter/webcenterapp/metadata/webcenter-config.xml’)
-> Change XXX parameter to XX MB in /oracle/webcenter/webcenterapp/metadata/webcenter-config.xml file.
-> Then import the file back to WebCenter Spaces server following the below mentioned command line.
importMetadata(application=’webcenter’, server=’WC_SpacesXXX’, fromLocation=’/tmp/Metadata’, docs=’/oracle/webcenter/webcenterapp/metadata/webcenter-config.xml’)
-> exit();
Happy Learning with Vinay Kumar in techartifact…