Creating Templates and Domains Using the pack and unpack Commands
Command Reference: pack and unpack
This section describes the purpose, syntax, and parameters of the pack and unpack commands.
pack
The pack command creates a template (a .jar archive file) that contains a snapshot of either an entire domain or a subset of a domain. You can use a template that contains a subset of a 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.
Managed server The following files and directories are included by default: The following files and directories are not included in a managed server template 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 domain
- bin directory
- lib directory
- All files and subdirectories in the config directory
- Applications and certain application initialization files
- 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 domain, such as DefaultAuthenticatorInit.ldift and XACMLRoleMapperInit.ldift.
The config.xml file of the 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 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.
Syntax
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]
Parameters
Table 2-2 describes the parameters that you can use with the pack command.
Table 2-2 Parameters: pack Command Parameter Required or Optional? Description -domain=domain Required The full or relative path for the domain from which the template is to be created. -template=template Required The full or relative path and filename of the template to be created. The template filename must include the .jar extension. -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 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, config.xml, 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.
Example
To create a template based on an existing domain named mydomain that is located in the C:\bea\user_projects\domains directory, run the following command:
pack -domain=C:\bea\user_projects\domains\mydomain -template=C:\bea\user_templates\mydomain.jar -template_name="My WebLogic Domain"A template file named mydomain.jar is created in the C:\bea\user_templates directory. The name of the template is My WebLogic Domain.
Related Topic
How Do I Create and Start a Managed Server on a Remote Machine?
unpack
The unpack command creates a full 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 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 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 designates the node manager installation directory for the product installation on the remote machine. By default, this directory is located in WL_HOME/common/nodemanager.
By default, application files are not included in a managed server template created by using the pack command. If an application in the 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 will not contain any of the externally staged applications. Before you start the managed server, you will need to make sure that it has access to the externally staged application files. For more information, see Controlling Deployment File Copying with Staging Modes in Deploying Applications to WebLogic Server.
For more information about using the pack and unpack commands to create a managed server domain directory, see How Do I Create and Start a Managed Server on a Remote Machine?.
Syntax
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]
Parameter
Table 2-3 describes the parameters that you can use with the unpack command.
These parameters are not applicable if you are creating a 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 domain.
This parameter is not applicable if you are creating a 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 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.
Example
To create a domain named mydomain.jar in the C:\bea\user_templates directory, by using the my_new_domain template in the C:\bea\user_projects\domains directory, run the following command:
unpack -template=C:\bea\user_templates\mydomain.jar -domain=C:\bea\user_projects\domains\my_new_domainRelated Topic
How Do I Create and Start a Managed Server on a Remote Machine?