Showing posts with label backupconfig. Show all posts
Showing posts with label backupconfig. Show all posts

Back up your application data.

This category covers the data stores used by your WebSphere Application Server applications. Unless your applications serve only static information, these resources are usually quite dynamic. You should back these up the same way you back up other business data on your system. These resources are suited for inclusion in a regularly scheduled backup.

For session recovery support, WebSphere Application Server provides distributed session support in the form of database sessions. You can use session recovery support when the user's session data must be maintained across a server restart or when the user's session data is too valuable to lose through an unexpected server failure.

All the attributes set in a session must implement java.io.Serializable if the session requires external storage. In general, consider making all objects held by a session serialized, even if immediate plans do not call for session recovery support. If the Web site grows, and session recovery support becomes necessary, the transition occurs transparently to the application if the sessions only hold serialized objects. If not, a switch to session recovery support requires coding changes to make the session contents serialized.

Taking backup of installed application

Exporting applications enables you to back up your applications and preserve binding information for the applications. You might export your applications before updating installed applications or migrating to a later version of the product.

To export applications, use the Export button on the Enterprise Applications page. Using Export produces an enhanced enterprise archive (EAR) file that contains the application as well as the deployment configuration. The deployment configuration consists of the deployment.xml and other configuration files that control the application behavior on a deployment target.



You can restore the backed up application any time using the WAS Admin Console using either the update or install button on Enterprise application button.

The application that you export this way is called enhanced enterprise application and this is how its content would look like



The deployment.xml has the binding information, this is how the sample deployment.xml looks like

<?xml version="1.0" encoding="UTF-8"?>
<appdeployment:Deployment xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:appdeployment="http://www.ibm.com/websphere/appserver/schemas/5.0/appdeployment.xmi" xmi:id="Deployment_1251509953840">
<deployedObject xmi:type="appdeployment:ApplicationDeployment" xmi:id="ApplicationDeployment_1251509953840" deploymentId="0" startingWeight="1" binariesURL="$(APP_INSTALL_ROOT)/dmgrCell01/perfServletApp.ear" useMetadataFromBinaries="false" enableDistribution="true" createMBeansForResources="true" reloadEnabled="false" appContextIDForSecurity="href:dmgrCell01/perfServletApp" filePermission=".*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755" allowDispatchRemoteInclude="false" allowServiceRemoteInclude="false">
<targetMappings xmi:id="DeploymentTargetMapping_1251509953856" enable="true" target="ServerTarget_1251509953856"/>
<classloader xmi:id="Classloader_1251509953856" mode="PARENT_FIRST"/>
<modules xmi:type="appdeployment:WebModuleDeployment" xmi:id="WebModuleDeployment_1251509953856" deploymentId="1" startingWeight="10000" uri="perfServletApp.war">
<targetMappings xmi:id="DeploymentTargetMapping_1251509953857" target="ServerTarget_1251509953856"/>
<classloader xmi:id="Classloader_1251509953857"/>
</modules>
</deployedObject>
<deploymentTargets xmi:type="appdeployment:ServerTarget" xmi:id="ServerTarget_1251509953856" name="server1" nodeName="dmgrNode01"/>
</appdeployment:Deployment>

restoreConfig command

Use the restoreConfig command to restore the configuration of your node after backing up the configuration using the backupConfig command.By default, all servers on the node stop before the configuration restores so that a node synchronization does not occur during the restoration. If the configuration directory already exists, it is renamed before the restoration occurs. If you directly make changes to the application files in the app_server_root/installedApps directory, a process known as "hot deployment", but do not make the same changes to the application files in the app_server_root/config directory, the changes might be overwritten if you use the restoreConfig command.

I tried restoring the configuration from WAS_DM_08_28_2009.zip file on my DMGR it took couple of minutes to execute this command



Now if i look at my DMGR_PROFILE directory i can see that the config directory before i executed restoreConfig command was renamed to config.old and the content of WAS_DM_08_28_2009.zip file was expanded into config directory

backupConfig command

The backupConfig command is a simple utility to backup the configuration of your node to a file. Before executing this command make sure that your configuration is in the consistent state and then synchronize to all the nodes.

When you execute backupConfig command it will storp the node before backup is made so that partically synchronized information is not saved so you can specify -nostop command line parameter so that the backup is taken without stopping the server

I took backup of my DMGR and it took couple of minutes to execute


After backup was taken i looked at the WAS_DMGR_08_24_2009.zip and this is how its content looks like


As you can see it took backup of PROFILE_HOME/config directory

Back up and restore Admin configuration

Websphere application server represents its administration configuration as XML files. You should back up the configuration on regular basis as well as before your make any big changes in the configuration. You can restore configuration from backed up file only if the WAS version is not chnaged i.e. WAS version at the time you backed up configuration should be same as that the time when you restored configuration.

Websphere provides following commands that you can use to back up and restore configuration

WebSphere Application Servers backupConfig command

The backupConfig command is a simple utility to back up the configuration of your node to a file. It is highly recommended that you backup your configuration before you make any major configuration change. When you execute the backupConfig command it will take backup of your profile configuration and if something goes wrong you can restore configuration by using restoreConfig command

I took backup of my WebSphere Portal profile by going to portal_profile_root/bin directory and executing this command


./backupConfig.sh /tmp/WebSphere_Portal_03_29_2009.zip


It took 4-5 minutes and after that i could see WebSphere_Portal_03_29_2009.zip file in the /tmp directory. When i looked inside that .zip file it looks like it copied content of portal_profile_root/config directory. On my portal installation i could see four folders under /config directory backup,cells,temp and template out of that it ziped cells and templates folders

This is how my config directory looks like

This is how my WebSphere_Portal_03_29_2009.zip looks like.


the .repository directory is also part of portal_profile_root/config directory but it is hidden. The backup does not include tmp and backup sub-folders of config directory

After reading the Infocenter the impression that i get is we can also copy config directory manually and restore it instead of using backupConfig and restoreConfig command but never tried that so not sure how it works