2.7.  Backup and restore a configuration.

[Note]

You can back up administrative configuration files using the backupConfig.sh command. You can restore administrative configuration files using the restoreConfig.sh command.

WebSphere Application Server represents its administrative configurations as XML files. You should back up configuration files on a regular basis.

Restore the configuration only if the configuration files that you backed up are at the same level of the release, including fixes, as the release to which you are restoring.

Backing up a profile

Use the backupConfig.sh command to back up a profile (node) configuration. Run this command from the was_home/bin directory, using the -profileName option to specify the profile to back up. Or, execute the command from the profile_home/bin directory to back up only this particular profile.

The backupConfig.sh command compresses the configuration files and stores the compressed file in the current directory or a specified path. The compressed file can be restored using the restoreConfig.sh command. By default, backupConfig.sh stops all servers in the configuration before performing the backup.


backupConfig.sh [backup_file] [-nostop] [-quiet] [-logfile <filename>]
	[-replacelog] [-trace] [-username <username>] [-password <password>]
	[-profileName <profile>] [-help]

					

The following options are available for the backupConfig.sh command:

The following example creates a backup ZIP file with autogenerated name and DOES NOT stop any servers before beginning the backup process:

test317:~ # cd /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/

test317:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin # ./backupConfig.sh -nostop

ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/backupConfig.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU5001I: Backing up config directory
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config to file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/WebSphereConfig_2013-08-19.zip
...
...
...
ADMU5002I: 1,232 files successfully backed up
					

test317:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin # ls -l *zip

-rw-r--r-- 1 root root 9798649 Aug 19 17:28 WebSphereConfig_2013-08-19.zip
					

Restoring a profile

Use the restoreConfig.sh command to restore a profile (node) configuration from an archive that was previously generated using backupConfig.sh for that profile. If the configuration to be restored exists, the configuration directory is renamed to config.old (then config.old_1, and so on) before the restore begins. The command then restores the entire contents of the profile_root/config directory. By default, all servers on the node stop before the configuration restores so that node synchronization does not occur during the restoration.

The restoreConfig.sh command syntax is shown below:


restoreConfig.sh backup_file [-location restore_location] [-quiet] [-nostop]
	[-nowait] [-logfile <filename>] [-replacelog] [-trace] [-username <username>]
	[-password <password>] [-profileName <profile>] [-help]

					

The following options are available for the restoreConfig.sh command:

The following example demonstrates correct syntax:

test317:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin # ./restoreConfig.sh WebSphereConfig_2013-08-19.zip
ADMU0116I: Tool information is being logged in file
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/restoreConfig.log
ADMU0128I: Starting tool with the AppSrv01 profile
ADMU0505I: Servers found in configuration:
ADMU0506I: Server name: server1
ADMU0506I: Server name: nodeagent
ADMU0506I: Server name: webserver1
ADMU2010I: Stopping all server processes for node exampleNode01
ADMU0510I: Server server1 is now STOPPED
ADMU0510I: Server nodeagent is now STOPPED
ADMU5502I: The directory /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config
           already exists; renaming to
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config.old
ADMU5504I: Restore location successfully renamed
ADMU5505I: Restoring file WebSphereConfig_2013-08-19.zip to location
           /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config
...
...
...
ADMU6001I: Begin App Preparation -
ADMU6009I: Processing complete.
ADMU6002I: Begin Asset Preparation -
ADMU6009I: Processing complete.
test317:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin #
					

test317:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01 # ls -ld config*
drwxr-xr-x 9 root root 4096 Aug 19 18:13 config
drwxr-xr-x 9 root root 4096 May 19 10:41 config.old
drwxr-xr-x 6 root root 4096 May 19 10:40 configuration
					

Professional hosting         Free 'Oracle Certified Expert Web Services Developer 6' Guide     Free SCDJWS 5.0 Guide