Backup and Restore of WebSphere Application Server configuration
Backup & Restore of IBM WebSphere Application Server Configuration
Backup configuration in WebSphere
One of the major activity that we can perform in Websphere as a pre-requisites when ever we intended to perform any major configuration changes like Fix Pack upgrade ,Interim Fix upgrade, JDK upgrade etc.
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.
Depending upon our diskspace 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.
Syntax:
We need to run the command from profile_root/bin
./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>
Note : This is bit expensive operation 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.
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>] -username <username> -password <password> -nostop
Ex:
./backupConfig.sh /opt/waslogs/backup/ProfileName.B4_MQ8Upgrade.zip -username <username> -password <password> -nostop
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 <Profilename>
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.
3) TAR BACKUP
This is not a WebSphere provided method where we can take tar backup of complete cell or was installation directory or folder using tar command.
Syntax:
tar -cvzf <Backupfile name.tar.gz> <Original Folder>
RESTORING THE BACKUP FILE
The restoreConfig command is a simple utility 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
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]
Ex:
./restoreConfig /opt/wasbkup/WebSphereConfig_2022-01-22.zip -username admin -password admin -nostop
-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.
Comments
Post a Comment