How to perform the backup and restore of WebSphere Application Server configuration?

0 comments



For any mission critical application, taking frequent backups is essential for recovering from severe errors. In the case of WebSphere Application Server, setting up of the application server environment is a demanding task and it is not an easy to repeat the setup if something bad happens. So, its wise to take backups whenever we make the first setup or when we do configuration changes.

TAKING BACKUPS IN WEB SPHERE APPLICATION SERVER

Depending upon our memory availability two types of backups is possible.

1) Full Backup

A full backup can be performed by running the ./backupConfig command from the

<WAS-ROOT>/bin directory. This will backup all the configuration files under
<WAS-ROOT>. We can go for a full backup if we have enough disk space.
<WAS-ROOT> is the directory where the Network Deployment Package is installed.

An example is /apps/Websphere/NdmServer/

2) Individual profile backup

We can perform backup for specific profiles by running the ./backupConfig command from the <WAS-ROOT>/bin directory with –profileName option.

e.g.

./backupConfig.sh –profileName sawfdn

An alternative to this is to run the ./backupConfig command directly from the

<PROFILE-ROOT>/bin directory without –profileName option.

<PROFILE-ROOT> is the directory where the configuration files for the particular profile is located. An example is /apps/Websphere/NdmServer/profiles/sawfdn.

Let us see in detail, how this backupConfig works. We shall assume the command is run from <PROFILE-ROOT> for our further discussions.

./backupConfig.sh

This will stop the nodeagent process and the servers linked to that nodeagent as managed servers. All the files under the <profile-root> will be backed up into a zip file named WebsphereConfig_DATE.zip where DATE is in the format YYYY-MM-DD. This zip file will be placed in the current directory. The information about the backup will be logged into a file named backupconfig.log under the <profile-root> If we want to have a different name for the backup file, we can do so by running the command as follows. We can also generate log in a different name.

./backupConfig.sh [backup_filename] [-logfile <filename>]

e.g.

./backupConfig.sh profilebackup_30-Jan.zip –logfile profilebackup_30-Jan.log

If Websphere Security is enabled, it is necessary to supply User Name and Password for the command.

e.g.

./backupConfig.sh –username admin –password admin123

Other options for this command are

-nostop

By default the servers under the profile which is being backed up will be stopped. This option instructs the command, not to stop any of the servers. The backup obtained will be a snapshot of what is there in memory. This will be suitable for production environments.

-quiet

This option suppresses the information displayed on the console

-replacelog

This option replaces the already existing default log file, if we do not specify a different name for the log file. By default the new information will be appended to the existing log file.

This is to generate detailed tracing information into the log file for debugging purposes.

Sample log information generated is shown below:
************ Start Display Current Environment ************
Host Operating System is SunOS, version 5.10
Java version = 1.5.0_10, Java Compiler = null, Java VM name = Java HotSpot(TM) 64-Bit
Server VM
was.install.root = /apps/WebSphere/NdmServer61
user.install.root = /apps/WebSphere/NdmServer61/profiles/sawfdn
Java Home = /apps/WebSphere/NdmServer61/java/jre
ws.ext.dirs =
/apps/WebSphere/NdmServer61/java/lib:/apps/WebSphere/NdmServer61/classes:/apps/WebSphere/
NdmServer61/lib:/apps/WebSphere/NdmServer61/installedChannels:/apps/WebSphere/NdmServer61
/lib/ext:/apps/WebSphere/NdmServer61/web/help:/apps/WebSphere/NdmServer61/deploytool/itp/
plugins/com.ibm.etools.ejbdeploy/runtime
Classpath =
/apps/WebSphere/NdmServer61/profiles/sawfdn/properties:/apps/WebSphere/NdmServer61/proper
ties:/apps/WebSphere/NdmServer61/lib/startup.jar:/apps/WebSphere/NdmServer61/lib/bootstra
p.jar:/apps/WebSphere/NdmServer61/lib/j2ee.jar:/apps/WebSphere/NdmServer61/lib/lmproxy.ja
r:/apps/WebSphere/NdmServer61/lib/urlprotocols.jar:/apps/WebSphere/NdmServer61/java/lib/t
ools.jar:
Java Library path =
/apps/WebSphere/NdmServer61/java/jre/lib/sparcv9/server:/apps/WebSphere/NdmServer61/java/
jre/lib/sparcv9:/apps/WebSphere/NdmServer61/java/jre/../lib/sparcv9:/apps/WebSphere/NdmSe
rver61/bin::/usr/lib
Current trace specification = *=info
************* End Display Current Environment *************

[2/19/08 18:59:52:486 IST] 0000000a ManagerAdmin I TRAS0017I: The startup trace state

is *=info.

[2/19/08 18:59:52:761 IST] 0000000a AdminTool A ADMU0128I: Starting tool with the
sawfdn profile
[2/19/08 18:59:52:767 IST] 0000000a AdminTool A ADMU5001I: Backing up config
directory /apps/WebSphere/NdmServer61/profiles/sawfdn/config to file
/apps/WebSphere/NdmServer61/profiles/sawfdn/bin/sawfdnbackup_190208
[2/19/08 19:00:01:930 IST] 0000000a AdminTool A ADMU0505I: Servers found in
configuration:
[2/19/08 19:00:01:935 IST] 0000000a AdminTool A ADMU0506I: Server name: nodeagent
[2/19/08 19:00:01:939 IST] 0000000a AdminTool A ADMU0506I: Server name:

After taking the backup we should start the nodeagent process by running the command,

./startNode.sh

from the <PROFILE-ROOT>/bin.
To start the server, login the Deployment Manager Console and go to Servers �� Application Servers. Check the box next to the server which was stopped during the backup process and click Start.

The server startup information is logged into

<PROFILE-ROOT>/logs/<SERVERNAME>/SystemOut.log.

RESTORING THE BACKUP FILE

The backup created in the above process can be restored for an emergency using restoreConfig command provided by Websphere. The usage of the command is as follows:

restoreConfig backup-file [-location <location>] [-quiet] [-nowait] [-logfile <logfile>]

[-replacelog] [-trace] [-username <username>] [-password <password>] [-profileName

<profileName>] [-help]

This command is similar to the backupConfig command except for a few options.

-location

This is the location to which the backup will be restored. The default location is <WASROOT>/config. This option will be useful if we have backed up the configuration of individual profile and want to restore it to the <PROFILE-ROOT>/config directory.

-nowait

This instructs the command to restore the configuration without stopping the servers.This is similar to nostop in backupConfig.

Note that the restoreConfig command will not run if you do not mention the backup-file name.

No comments:

Post a Comment

Recent Posts

Popular Posts

© 2011-2019 Web Portal Club