2 pack and unpack Command Reference

This section describes the purpose, syntax, and parameters of the pack and unpack commands.

2.1 The pack Command

The pack command creates 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.

Table 2-1 describes the files and directories that are included in the templates that you create by using the pack command.

Table 2-1 Files and Directories Included in Templates Creating by Using the pack Command

Template Type Files and Directories

Domain

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

If you configured additional security data, such as for users, groups, or roles, through the Oracle WebLogic Server Administration Console or other online tools, 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.

Managed Server

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, with the exception of config.xml

  • bin directory

  • lib directory

The following files and directories are not included in a Managed Server template by default:

  • Applications and certain application initialization files

  • config.xml

  • 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.

The config.xml file of the WebLogic domain from which you are creating your template must contain Managed Server definitions that specify the IP address and port for the target remote machine. The Managed Server template that you create from that WebLogic domain can only be used, with the unpack command, on the specified remote machines to create Managed Server domain directories for the Managed Servers defined in the config.xml file.


2.1.1 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_priority=log_priority]

2.1.2 Parameters of the pack Command

Table 2-2 lists the parameters of the pack command.

Table 2-2 Parameters of the pack Command

Parameter Required or Optional Description

-domain=domain

Required

The full or relative path for the WebLogic domain from which the template is to be created.

-template=template

Required

The full or relative path and file name of the template to be created. The template filename must include the .jar extension.

Note: The pack command does not overwrite existing files. If the file name that you specify matches the name of an existing file in the specified folder, the pack command fails.

-template_name="template name"

Required

Descriptive name for the template. Quotes are required only if the value contains spaces.

-template_author="author"

Optional

The name of the author of the template. Quotes are required only if the value contains spaces.

-template_desc="description"

Optional

Description of the template. Quotes are required only if the value contains spaces.

-managed=true|false

Optional

Specifies whether the template is to be used to create Managed Servers on remote machines. The default is false.When this parameter is set to true, a Managed Server template is created that contains a minimal set of files, including SerializedSystemIni.dat and nm_password.properties. It also includes a domain.properties file that is unique to the Managed Server template.Applications and certain application initialization files are not included.The resulting template can be used to create Managed Servers on remote machines.

-log=log_file

Optional

Name of the log file.

-log_priority=log_priority

Optional

The priority setting for the log file. Use a log4j priority string.

Valid log4j priority strings are debug, info, warn, error, and fatal. The priority string values correspond to the levels defined in the Level class. For more information, see http://logging.apache.org/log4j/docs/api/org/apache/log4j/Level.html.


2.1.3 Example for the pack Command

To create a template 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.

2.2 The unpack Command

The unpack command creates a full WebLogic domain or a subset of a domain used for a Managed Server domain directory on a remote machine.

You should use unpack only with a template that is compatible with your current installation. 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 containing all of the application and resource files defined in the template. It also creates necessary start scripts, and certain security and configuration files.

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

  • config_bootstrap.xml file (based on the config.xml in the template)

  • nm_password.properties file

  • 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 installation directory for the product installation on the remote machine. By default, this directory is located in WLS_HOME/common/nodemanager.

Note:

By default, application files are not included in a Managed Server template created by using the pack command. If an application in the WebLogic domain from which you created a Managed Server template was 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, see the "Controlling Deployment File Copying with Staging Modes" section in the Deploying Applications to Oracle WebLogic Server guide.

2.2.1 Syntax of the unpack Command

unpack -template=template -domain=domain [-user_name=username] [-password=password] [-app_dir=application_directory] [-java_home=java_home_directory] [-server_start_mode=dev|prod] [-log=log_file] [-log_priority=log_priority]

2.2.2 Parameters of the unpack Command

Table 2-3 lists the parameters that you can use with the pack command.

Table 2-3 Parameters of the unpack Command

Parameter Required or Optional Description

-template=template

Required

The full or relative path and filename of the template from which the WebLogic domain is to be created.

-domain=domain

Required

The full or relative path of the WebLogic domain to be created.

-user_name=username -password=password

Optional

The username and password for the default administrator as currently defined in the template. This username-password combination is used to boot the Administration Server and connect to it. If you specify a new password for the default administrator, the password is reset to the value specified.

Note: If a password for the default administrator is not defined in the template, you must specify one.

If no administrative users are defined in the template, you can create a new default administrator by specifying the -user_name and -password parameters.

If a default administrator and password are currently defined in the template, you can add a new administrative user by specifying the -user_name and -password parameters.

The value must not include commas, tabs, or any characters in the following list: < > # | & ? ( ) { }. Usernames are case sensitive.

A valid password consists of a string of at least eight case-sensitive characters. The unpack command encrypts the password value.

Note: These parameters are not applicable if you are creating a WebLogic domain using a Managed Server template.

-app_dir=application_directory

Optional

The full path to the directory used to store the applications defined in the template.

This parameter is applicable only if the template supports a separate applications directory.

-java_home=java_home_directory

Optional

The full path to the Java home directory. When set, this parameter identifies the default 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.

-server_start_mode=dev|prod

Optional

The start mode for the Administration Server: development or production.

This parameter is not applicable if you are creating a WebLogic domain by using a Managed Server template.

-log=log_file

Optional

Name of the log file.

-log_priority=log_priority

Optional

The priority setting for the log file. Use a log4j priority string.

Valid log4j priority strings are debug, info, warn, error, and fatal. The priority string values correspond to the levels defined in the Level class. For more information, see http://logging.apache.org/log4j/docs/api/org/apache/log4j/Level.html.


2.2.3 Example for the unpack Command

To create a WebLogic domain named mynewdomain.jar 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\my_new_domain