Wednesday, December 17, 2014

How to import and Export Webcenter Portal MDS Data using WLST Scripts


What is MDS Data ?

Oracle Metadata Services (MDS) Repository contains metadata for certain types of deployed applications. Those deployed applications can be custom Java EE applications developed by your organization and some Oracle Fusion Middleware component applications, such as Oracle B2B and Oracle Web Services Manager. A Metadata Archive (MAR), a compressed archive of selected metadata, is used to deploy metadata content to the MDS Repository, which contains the metadata for the application.

For More Info, Please Refer http://docs.oracle.com/cd/E29542_01/core.1111/e10105/repos.htm#ASADM494

What is WLST Script ?

The WebLogic Scripting Tool (WLST) is a command-line scripting interface that system administrators and operators use to monitor and manage WebLogic Server instances and domains. The WLST scripting environment is based on the Java scripting interpreter, Jython. In addition to WebLogic scripting functions, you can use common features of interpreted languages, including local variables, conditional variables, and flow control statements. WebLogic Server developers and administrators can extend the WebLogic scripting language to suit their environmental needs by following the Jython language syntax

For more Info , Refer http://docs.oracle.com/cd/E13222_01/wls/docs90/config_scripting/using_WLST.html

Follow below steps in order to execute WLST Script

Step 1 : Execute wlst.sh , Go to common/bin directory and execute as shown below

               /devbox/fmw/product/111/wcp_111/common/bin> ./wlst.sh

Step 2 : Connect to respective server as shown below
                  fmadmin - User ID
                  simple4u - Password
                  Admin Server IP Address
                  Admin Server Port

                     connect('fmadmin','simple4u','t3://129.155.137.216:44501')

Step 3: Execute below command to export the data. Make sure upon successful export, you should see a message " Successfully exported"

exportMetadata(application='FM_PortalApp1',server='WC_CustomPortal1',toLocation='/tmp/Oracle',docs='/**')

For More Info : http://docs.oracle.com/cd/E29542_01/webcenter.1111/e27738/wcadm_imp_exp_fw.htm#WCADM359

Step 4 : To Import, execute below command

importMetadata(application='FM_PortalApp1', server='WC_CustomPortal', fromLocation='/tmp/myrepos', docs='/**')