![]() | |
|
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:
-nostop
Tells the backupConfig.sh
command not to stop the servers
before backing up the configuration.
-quiet
Suppresses the progress information that the backupConfig.sh
command prints in normal mode.
-logfile file_name
Specifies the location of the log file to which trace information is written. By
default, the log file is named backupConfig.log
and is created in the logs
directory.
-profileName profile_name
Defines the profile of the application server process in a
multi-profile installation. The -profileName
option is not required for running in a
single-profile environment. The default for this option is the default profile.
-replacelog
Replaces the log file instead of appending to the current log.
-trace
Generates trace information into the log file for debugging purposes.
-username user_name
Specifies the user name for authentication if security is enabled in
the server; acts the same as the -user
option.
-user user_name
Specifies the user name for authentication if security is enabled in
the server; acts the same as the -username
option.
-password password
Specifies the password for authentication if security is enabled in the server.
-help
Prints a usage statement.
-?
Prints a usage statement.
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:
-help
Prints a usage statementю
-location directory_name
Specifies the directory where the backup file is restored.
The location defaults to the app_server_root/config
directory.
-logfile file_name
Specifies the location of the log file to which trace information is written.
By default, the log file is named restoreConfig.log
and is created in your logs directory.
-nostop
Tells the restoreConfig.sh
command not to stop the servers before restoring the configuration.
-password password
Specifies the password for authentication if security is enabled in the server.
-profileName profile_name
Defines the profile of the Application Server process in a
multiple-profile installation. The -profileName
option is not required for running in a
single profile environment. The default for this option is the default profile.
-quiet
Suppresses the progress information that the restoreConfig command prints in normal mode.
-replacelog
Replaces the log file instead of appending to the current log.
-trace
Generates trace information into the log file for debugging purposes.
-username user_name
Specifies the user name for authentication if security is enabled
in the server; acts the same as the -user
option.
-user user_name
Specifies the user name for authentication if security is enabled in
the server; acts the same as the -username
option.
-?
Prints a usage statement.
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
![]() ![]() ![]() |