2 Pack and Unpack Command Reference
pack
and unpack
commands have unique syntaxes and parameters. The commands are located in the ORACLE_HOME
/oracle_common/common/bin
directory. This chapter includes the following sections:
- The Pack Command
Thepack
command helps you create a template (a.jar
archive file) that contains a snapshot of either an entire WebLogic domain or a subset of a WebLogic domain. - The Unpack Command
Theunpack
command helps you create a full WebLogic domain or a subset of a domain that is used for a Managed Server domain directory on a remote system.
The Pack Command
The pack
command helps you create a template (a .jar
archive file) that contains a snapshot of either an entire WebLogic domain or a subset of a WebLogic domain.
You can use a template that contains a subset of a WebLogic domain to create a Managed Server domain directory hierarchy on a remote machine.
The following sections describe the files and directories that are included in the domain and Managed Server templates that you create by using the pack
command.
- Files and Directories Included in Domain Templates
- Porting Security Provider Data to a New Domain
- Files and Directories Included in Managed Server Templates
- Node Manager Configuration
- Syntax of the Pack Command
- Parameters of the Pack Command
- Example of the Pack Command
Parent topic: Pack and Unpack Command Reference
Files and Directories Included in Domain Templates
All files and directories in the source WebLogic domain are included, with the following exceptions:
-
Temporary files that are created when you start a server
-
The servers directory
-
Files in the security directory that are created automatically when you create the WebLogic domain, such as
DefaultAuthenticatorInit.ldift and XACMLRoleMapperInit.ldift
-
Persistent file stores, even if they are located with the domain. File stores are excluded whether they are defined for JMS or other file systems. If the file store is located within the domain, an empty file store directory is created on the target system.
In addition to files within the domain directory, deployment plans located in external directories are included in the template that is created by pack
. These resources are copied by unpack
to the following standard location in the domain:
domain_home
/config/deployments/
deployment_name
/plan
Note:
Plans already within the domain are not relocated.
External directories include locations outside of the Oracle home directory, the domain home, and any location defined in the ORACLE_HOME/oracle_common/common/lib/internalpaths.txt
file.
If you have configured additional security data through the Oracle WebLogic Server Administration Console or other online tools, such as for users, groups, or roles, the security data is stored in the LDAP server and is not included in the template. You must first export the data and then import it into the target WebLogic domain.
Parent topic: The Pack Command
Porting Security Provider Data to a New Domain
Because it is an offline command, the pack
command does not export security provider data, such as embedded LDAP data, into a domain template. After using unpack
to create the new domain, you must manually port the security provider data to the new domain. To do so:
- If necessary, start the Administration Server for the original domain and sign in to the Administration Console of the original domain.
- Export the data from the original domain as described in Export data from a security provider in the Oracle WebLogic Server Administration Console Online Help.
- If necessary, start the Administration Server for the new domain and sign in to the Administration Console of the new domain.
- Import the data into the new domain as described in Import data into a security provider in the Oracle WebLogic Server Administration Console Online Help.
Parent topic: The Pack Command
Files and Directories Included in Managed Server Templates
The following files and directories are included by default:
-
All files in the root directory with the following extensions:
.cmd
,.sh
,.xml
,.properties
, and.ini
-
Any files with the
.pem
extension defined in the SSL configuration for your WebLogic domain -
All files and subdirectories in the
config
directory, exceptconfig.xml
-
The
bin
directoryNote:
Do not pack all the files under the
bin
directory into the template, but only the non-autogenerated files. The autogenerated files are re-created during the unpack process and you may lose the changes.To check the complete file list, use the following command:
$DOMAIN_HOME/init-info/startscript.xml
-
The
lib
directory
The following files and directories are not included in a Managed Server template by default:
-
Applications and certain application initialization files
-
The
config.xml
file -
Temporary files that are created when you start a server
-
The servers directory
-
Files in the security directory that are created automatically when you create the WebLogic domain, such as
DefaultAuthenticatorInit.ldift
andXACMLRoleMapperInit.ldift
You can pack any domain, whether or not it specifies specific names or ports for the servers in the domain. You can then unpack the domain on any system, but servers that are defined in the config.xml
file to use specific systems and ports will not work on other systems. Therefore, you must unpack the same template on each remote node for all servers to start successfully on their appropriate nodes and systems.
Parent topic: The Pack Command
Node Manager Configuration
The pack
and unpack
commands do not preserve Node Manager configuration for both managed and non-managed modes. By default, the Node Manager type is always set to PerDomainNodeManager
in the unpacked domain.
If the Node Manager type in the original domain was CustomLocationNodeManager
when the domain was unapcked, you must include the -nodeManagerType
and -nodeManagerHome
parameters in the unpack
command to preserve the configuration.
If the Node Manager type in the original domain was ManualNodeManagerSetup
, you must manually reconfigure Node Manager after you unpack the domain on each remote system.
If a ManualNodeManagerSetup
configuration was used for the original domain, the Node Manager configuration information is discarded from the template that pack
creates. When you unpack the domain, specify ManualNodeManagerSetup
using the -nodeManagerType
parameter. After you unpack the domain, you must manually configure Node Manager.
For information about Node Manager types, see Default Node Manager Configuration in Administering Node Manager for Oracle WebLogic Server.
Node Manager credentials are copied from the packed domain to the unpacked domain. These credentials are stored in config.xml file.
Parent topic: The Pack Command
Syntax of the Pack Command
pack -domain=domain -template=template -template_name="template_name" [-template_author="author"] [-template_desc="description"] [-managed=true|false] [-log=log_file] [-log=log_file] [-log_priority=log_priority]
Parent topic: The Pack Command
Parameters of the Pack Command
Table 2-1 lists the parameters of the pack
command.
Table 2-1 Parameters of the Pack Command
Parameter | Required or Optional | Description |
---|---|---|
|
Required |
The full or relative path of the WebLogic domain from which the template is to be created. |
|
Required |
The full or relative path and file name of the template to be created. The template filename must include the Note: The |
|
Required |
The descriptive name for the template. Quotes are required only if the value contains spaces. |
|
Optional |
The name of the author of the template. Quotes are required only if the value contains spaces. |
|
Optional |
The description of the template. Quotes are required only if the value contains spaces. |
|
Optional |
Specifies whether the template is to be used to create Managed Servers on remote systems. The default is Note: As of WebLogic Server 12.1.2, you can use the WLST |
|
Optional |
The name of the log file. |
|
Optional |
The priority setting for the log file. Use a log4j priority string. Valid log4j priority strings are |
Parent topic: The Pack Command
Example of the Pack Command
To create a template JAR file based on an existing WebLogic domain named mydomain
that is located in the C:/oracle/user_projects/domains
directory, run the following command:
pack -domain=C:/oracle/user_projects/domains/mydomain -template=C:/oracle/user_templates/mydomain.jar -template_name="My WebLogic Domain"
A template file named mydomain.jar
is created in the C:/oracle/user_templates
directory. The name of the template is My WebLogic Domain
.
Parent topic: The Pack Command
The Unpack Command
The unpack
command helps you create a full WebLogic domain or a subset of a domain that is used for a Managed Server domain directory on a remote system.
You must use unpack
only with a template that is compatible with your current installation. The current installation binaries must exist on the system on which you are running the unpack
command. The template can be any of the following:
-
A domain template that is packaged with your current installation
-
A domain template created by using the Domain Template Builder or WLST
-
A domain template created by using the
pack
command -
A Managed Server template created by using the
pack
command
When you use the unpack
command with a domain template, it creates a WebLogic domain that contains all the application and resource files defined in the template. It also creates necessary start scripts, and certain security and configuration files.
Note:
The source domain must have both an administrator user and an administrator password defined for the domain. Otherwise, an error is displayed when you run the unpack
command. You can define the administrator password for the source domain in the wallet that is specified by the unpack command's walletDir
option.
When you use the unpack
command with a Managed Server template, it creates a Managed Server domain directory that includes the following:
-
A customized start script for each Managed Server in the WebLogic domain
-
The
config_bootstrap.xml
file (based on theconfig.xml
file in the template) -
The
nm_password.properties
file -
The
SerializedSystemIni.dat
file
An entry for the Managed Server domain directory is also created in the NM_HOME
/nodemanager.domains
file, where NM_HOME
is the node manager home directory for the product installation on the remote system. The location of this directory depends on the Node Manager type. For more information about Node Manager type and Node Manager home, see Table 2-2.
Note:
By default, application files are not included in a Managed Server template that is created by using the pack
command. If an application in the WebLogic domain from which you have created a Managed Server template is deployed by using the external_stage
mode, the Managed Server domain directory that you create with the unpack
command does not contain any of the externally staged applications. Before you start the Managed Server, you must ensure that it has access to the externally staged application files.
For more information about the deployment staging mode, see Controlling Deployment File Copying with Staging Modes in Deploying Applications to Oracle WebLogic Server.
Parent topic: Pack and Unpack Command Reference
Syntax of the Unpack Command
unpack [-initialize] -template=template -domain=domain [-walletDir=directory] [-user_name=username] [-password=password] [-app_dir=application_directory] [-nodemanager_type=type] [-nodemanager_home=nodemanager_home_directory] [-java_home=java_home_directory] [-server_start_mode=dev|prod] [-overwrite_domain] [-log=log_file] [-log_priority=log_priority]
Parent topic: The Unpack Command
Parameters of the Unpack Command
Table 2-2 lists the parameters that you can use with the unpack
command.
Table 2-2 Parameters of the Unpack Command
Parameter | Required or Optional | Description |
---|---|---|
|
Optional |
This parameter applies only to WebLogic domains in which Fusion Middleware products are installed. Note: When setting this parameter to When this parameter is When this parameter is When this parameter is For information about Service Tables, see Understanding Service Tables in Administering Oracle Fusion Middleware. |
|
Required |
The full or relative path and name of the template from which the WebLogic domain is to be created. |
|
Required |
The full or relative path of the WebLogic domain to be created. |
|
Optional |
The directory location of the wallet file that contains the password of the administration user account. This directory is the same directory that you used when you created the wallet file by using the
If you want to create a different administrator user for the domain that you are unpacking, do the following:
Note: The |
|
Optional |
The user name for the default administrator as currently defined in the template or through the If no administrative users are defined in the template, you can create a new default administrator by using If a default administrator and password are currently defined in the template, you can add a new administrative user by using User names must be unique. For the WebLogic Authentication provider (DefaultAuthenticator), user names are case insensitive. User names must not include tabs or any of the following character:
In addition, user names must not begin with the following characters:
Note: If you create a user name with any of the preceding invalid characters, the WebLogic domain can become corrupted. A valid password consists of a string of at least eight characters. The Note: This parameter is not used if you are creating a WebLogic domain by using a Managed Server template. |
|
Optional |
This parameter is deprecated. For better security, use the
A valid password consists of a string of at least eight case-sensitive characters. The Note: When you unpack a template that was created by using the managed option, you cannot change the password. The |
|
Optional |
The full path of the directory that is used to store the applications that are defined in the template. Note: If the template includes applications that are located outside of the product installation directory and in a separate applications directory, then this option specifies where to copy the applications from the template. If the template does not contain any of these applications, then specifying the |
|
Optional |
Sets the Node Manager type for the domain that you are creating. Specify one of the following types:
The default value is |
|
Conditional |
If the specified Node Manager type is If the specified Node Manager type is not |
|
Optional |
The full path of the Java home directory. When set, this parameter identifies the default Java Virtual Machine (JVM) used by the Administration Server for the WebLogic domain. This parameter is not applicable if you are creating a WebLogic domain based on a Managed Server template. |
|
Optional |
The start mode for the Administration Server: Note: If you want the unpacked domain to run in production mode, you must include this parameter in the This parameter is not applicable if you are creating a WebLogic domain by using a Managed Server template. If |
|
Optional |
If the specified domain directory exists and is not empty, the files in the directory are automatically overwritten without warning. No attempt is made to merge or preserve local customizations. Note: If a system error occurs after domain generation starts, the domain directory will be in an unknown state. |
|
Optional |
The name of the log file. |
|
Optional |
The priority setting for the log file. Use a log4j priority string. Valid log4j priority strings are |
Parent topic: The Unpack Command
Example for the Unpack Command
To create a WebLogic domain named mynewdomain
in the C:/oracle/user_projects/domains
directory by using the mydomain.jar
template in the C:/oracle/user_templates
directory, run the following command:
unpack -template=C:/oracle/user_templates/mydomain.jar -domain=C:/oracle/user_projects/domains/mynewdomain
Parent topic: The Unpack Command