Daily SOA MDS Backup by WLST

MDS Repository is the central place for storing and keeping configuration files, page customization, personalization elements for WebCenter and SOA Suite.

The MDS is basically an XML store with transaction capabilities, versioning, merging and a persistence framework optimized to work with XML nodes and attributes. The persistence framework has two adapters that can persist the store to a database or to a folder on disk. The database store has more advanced features is the recommended way of working with MDS. The file store is useful for at development time, because one can change the files manually.

The best approach is do a full back up of MDS repository schema using database backup utilities. The backup can be restored if there is any issue with the MDS schema. Usually, the backup is done form EM Console by using MDS Configuration page. To do that, click on soa-infra and click Administration and MDS Configuration, and then click Export on MDS Configuration page.

SOA EM Console > Farm_$Domain > SOA  soa-infra > Administration (Right Click Menu) > MDS Configuration

SOA EM Console > Farm_$Domain > SOA soa-infra > Administration (Right Click Menu) > MDS Configuration

Today, instead of using interface backup, we’ll be using WLST to backup MDS repository.

The main function to backup MDS is exportMetadata, so the following codes will back up your daily MDS Repository by adding this wlst code to your server’s cron.

import time
import datetime
today_string = datetime.datetime.now().strftime("%Y%m%d%H%M")
print today_string
file_name = str("MDS_EXPORT") + today_string + str(".zip")
location = str("/soadata/DAILY_MDS_BACKUP/")+file_name
print file_name
print location
  exportMetadata(application='soa-infra',server='soa1',toLocation=location, docs='/**')
  fo = open("/soadata/DAILY_MDS_BACKUP/MDSBackupHistory.log", "a")
  fo.write("DATE: " + today_string + "...\n")
  fo.write("Successfully exported :"+file_name+"\n")
except Exception, e:
  fo = open("/soadata/DAILY_MDS_BACKUP/MDSError.log", "a")
  fo.write("DATE: " + today_string + "...\n")


Tags: ,

About the Author

Ayten Sarifakioglu is a Middleware Consultant and works onsite at Turk Telekom, Ankara. She daily operates high level, mission critical OSB and SOA domains successfully.

Post a Reply

Your email address will not be published. Required fields are marked *