Bootstrap FreeKB - IBM WebSphere - backupConfig script
IBM WebSphere - backupConfig script

Updated:   |  IBM WebSphere articles

The backupConfig.sh (Linux) or backupConfig.bat (Windows) script can be used to create a backup of a WebSphere application server or profile.

When the backupConfig script is invoked from the ${WAS_INSTALL_ROOT}/bin directory, the entire application server will be backed up.

${WAS_INSTALL_ROOT}/bin/backupConfig.sh example.zip

 

When the backupConfig script is invoked from the ${WAS_INSTALL_ROOT}/bin/profiles/your_profile/bin directory, the profile wil be backed up. In this scenario, profile "AppSrv01" will be backed up.

${WAS_INSTALL_ROOT}/bin/profiles/AppSrv01/bin/backupConfig.sh example.zip

 


Linux Permissions and Ownership / tar archives

The backupConfig.sh and restoreConfig.sh scripts will not store the file permissions and ownership of files. For example, if file1.txt is owned by Admins and has permissions -rwxrwsr-x, the owner and permissions may not be proper after invoking the restoreConfig.sh script. For this reason, it is recommended to not use the backupConfig.sh and restoreConfig.sh scripts on Linux, and to instead use the tar command to create and restore. In this scenario, you will want to create tar archives of the following directories:

  • WebSphere base directory (e.g. /opt/WebSphere/AppServer)
  • Installation Manager base directory (e.g. /opt/InstallationManager)
  • Installation Manager user data directory (e.g. /home/john.doe/var/ibm/InstallationManager)

As an example, here are example command to create each of these tar archives with the --create and --preserve-permissions and --file options.

tar --create --preserve-permission --file websphere.tar /opt/WebSphere/AppServer
tar --create --preserve-permission --file installationmanager.tar /opt/InstallationManager
tar --create --preserve-permission --file installationmanageruserdata.tar /home/john.doe/var/ibm/InstallationManager

 

Additionally, you will want to create a copy of your users InstallationManager.dat file. This file contains the current version of Installation Manager. If Installation Manager gets corrupted or is updated to a new version, this file can be used to restore Installation Manager.

cp /home/john.doe/etc/.ibm/registry/InstallationManager.dat InstallationManager.dat.backup

 

Then, if you need to restore WebSphere, you would simply extract the tar archives with the --extract and --file options and replace the InstallationManager.dat file, something like this.

tar --extract --file websphere.tar --directory /opt/WebSphere/AppServer
tar --extract --file installationmanager.tar --directory /opt/InstallationManager
tar --extract --file installationmanageruserdata.tar --directory /home/john.doe/var/ibm/InstallationManager
cp InstallationManager.dat.backup /home/john.doe/etc/.ibm/registry/InstallationManager.dat

 


-nostop option

By default, the backupConfig command will stop the nodes, which means that the application servers and applications in the nodes are also stopped. This ensures that the back up does not occur while a change is being made to the master configuration, which could produce some problems when attempting to restore the backup. In a non-clustered environment, this produces some downtime, as the nodes/application servers/applications will be stopped while the backupConfig script is executing. 

Note - The nodes/application servers/application will automatically start after the backupConfig script completes its execution

The -nostop option can  be used to not stop the nodes as part of the backup.

backupConfig.sh example.zip -nostop

 


-username -password options

If administrative security is enabled, the backupConfig command without any options will prompt you to provide a username and password. The -username and -password options can be used to provide the username and password on the command line. However, you should avoid using the -username and -password options, as the username and password can easily be intercepted using the ps command (Linux). This is another reason why the TAR command should be used instead, as the TAR command does not expose your username and password.

backupConfig.sh example.zip -username your_username -password your_password

 


Restore a backup

The restoreConfig.sh (Linux) or restoreConfig.bat (Windows) scripts are used to restore a backup.




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 108b4f in the box below so that we can be sure you are a human.