Bootstrap FreeKB - IBM WebSphere - restoreConfig script
IBM WebSphere - restoreConfig script

Updated:   |  IBM WebSphere articles

This assumes you have backed up a WebSphere application server or profile using the backupConfig.sh (Linux) or backupConfig.sh (Windows) scripts.

The restoreConfig.sh (Linux) or restoreConfig.bat (Windows) command can be used to restore a WebSphere application server or profile.

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

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

 

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

${WAS_INSTALL_ROOT}/bin/profiles/AppSrv01/bin/restoreConfig.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 restoreConfig command will stop the nodes, which means that the application servers and applications in the nodes are also stopped. In a non-clustered environment, this produces some downtime, as the nodes/application servers/applications will be stopped while the restoreConfig script is executing. 

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

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

restoreConfig.sh example.zip -nostop

 


-username -password options

If administrative security is enabled, the restoreConfig 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.

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

 


config.old directory

If the ${WAS_INSTALL_ROOT}/profiles/your_profile/config directory exists, it will be renamed to config.old, and then the config directory will be restored from the backup zip file. The following will be displayed in the console.

ADMU5502I: The directory was_home/profiles/profile01/config already exists;
           renaming to was_home/profiles/profile01/config.old
ADMU5504I: Restore location successfully renamed
ADMU5505I: Restore file backup.zip to location was_home/profiles/profile01/config

 




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 a07501 in the box below so that we can be sure you are a human.