Skip navigation.
Downloads | Product Documentation | Support

Creating Templates and Domains Using the pack and unpack Commands

# Introduction

This document describes how to use the `pack` and `unpack` commands to create templates and domains.

Topics in this section include:

- Overview of the pack and unpack Commands
- About Domain and Managed Server Templates
- Additional Tools for Creating Templates and Domains

# Overview of the pack and unpack Commands

BEA provides several tools for creating domains and templates: the Configuration Wizard, the Domain Template Builder, WLST Offline, and the `pack` and `unpack` commands. The `pack` and `unpack` commands provide a simple, one-step method for creating domains and templates from the command line. They do not, however, allow you to customize the contents of your domain or template in the same way as the other tools. For more information about creating templates and domains using the Configuration Wizard, the Domain Template Builder, or WLST Offline, see Additional Tools for Creating Templates and Domains.

This section provides the following topics:

- Location of Command Scripts
- About the pack Command
- About the unpack Command

## Location of Command Scripts

On both Windows and UNIX systems, `pack` and `unpack` are installed in the `\common\bin` subdirectory of the product installation directory, for example `C:\bea\weblogic90\common\bin`.

## About the pack Command

The `pack` command provides an alternative means for quickly creating a template from the command line in one simple step. Although the `pack` command does not allow you to customize the contents of your template in the same way as the Domain Template Builder, it is a useful tool for quickly creating the following:

- A domain template that contains a snapshot of an entire working domain that has been customized through the Administration Console, Configuration Wizard, or WebLogic Scripting Tool (WLST). This template can then be used to create a domain using `unpack`, the Configuration Wizard, or WebLogic Scripting Tool (WLST) Offline.
- A Managed Server template that contains a subset of the files in a domain that are required to create a Managed Server domain directory hierarchy on a remote machine. You can then use `unpack` to create the Managed Server domain directory on the remote machine. For more information, see Creating and Starting a Managed Server on a Remote Machine: Main Steps.

For a complete description of the `pack` command, see pack.

For additional information about the Domain Template Builder, the Configuration Wizard, or WLST, see Additional Tools for Creating Templates and Domains.

## About the unpack Command

The `unpack` command provides a one-step method for quickly creating a domain from an existing template using the default settings defined in the template. When creating a domain, `unpack` does not provide the same customization options as the Configuration Wizard or WLST. However, if you use the `unpack` command with a domain template, you can do the following:

- Change the password for the default administrative user defined in the template
- Add an administrative user when the default administrative user already has a password specified in the template
- Specify the JDK and start mode for the domain
- Specify an applications directory, if one is supported by the template

Using `unpack`, you can also create a Managed Server domain directory using a Managed Server template created using the `pack` command. Because a Managed Server uses the settings defined for the Administration Server, you cannot change the JDK or the start mode, add administrative users, or change the Administrator password.

Note: You cannot use `unpack` to extend an existing domain.

For a complete description of the `unpack` command, see unpack.

For additional information about the Configuration Wizard, Domain Template Builder, or WLST, see Additional Tools for Creating Templates and Domains.

# About Domain and Managed Server Templates

When you are using `pack` and `unpack`, the term template refers to a Java Archive (JAR) file that contains the files and scripts required to create a domain.The types of templates that can be created by the `pack` command and used by the `unpack` command to create domains include:

- Domain template—defines the full set of resources within a domain, including infrastructure components, applications, services, security options, and general environment and operating system options. Using the `pack` command, you can create a domain template from an existing domain. A domain template is used to create a new domain.
- Managed Server template—defines the subset of resources within a domain that are required to create a Managed Server domain directory on a remote machine. You create a Managed Server template using the `pack` command, with the `-managed=true` option. Subsequently, when you use the Managed Server template with the `unpack` command, the Managed Server domain directory that is created contains sufficient bootstrap information to start the Managed Server on the remote machine. You can start the Managed Server on the remote machine in either of two ways: using Node Manager, or using customized start scripts created when you unpacked the template on the remote machine.

Note: 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.

# Additional Tools for Creating Templates and Domains

Your BEA software provides several tools for creating templates and domains. The `pack` and `unpack` commands provide a one-step method for creating templates and domains. You can also use the tools defined in the following table to create templates and domains.

Table 1-1 Additional Tools for Creating Templates and Domains

To perform this task . . . | Use these tools . . .
--- | ---
Create a template | Domain Template Builder—a stand-alone Java application that guides you through the process of creating custom domain and extension templates using a graphical user interface. The Domain Template Builder provides more control over template customization than the `pack` command. In addition to customizing basic template information, you can also control the following: - Application and domain directory contents - Database configuration scripts - Administration Server configuration - Basic security configuration - Start menu entries - Customized scripts and variables For more information, see Creating Templates Using the Domain Template Builder. WLST Offline—a command-line scripting interface that you use to create a new domain or update an existing domain without connecting to a running WebLogic Server. The `writeTemplate` functionality of WLST Offline provides the same capability for creating a domain template as the `pack` command. You cannot create a Managed Server template using WLST Offline. For more information, see "Creating a Domain Template (Offline)" in "Creating and Configuring WebLogic Domains Using WLST Offline" in ``WebLogic Scripting Tool.
Create a new domain or extend an existing domain | Configuration Wizard—a stand-alone Java application that guides you through the process of creating or extending a domain. When creating a new domain, you can choose to accept the default settings or to customize the domain to more closely match your particular environment by adding and configuring Managed Servers, clusters, and machine definitions, or customizing predefined JDBC data sources, and JMS file store directories. You can also use the Configuration Wizard to extend an existing domain by adding predefined applications, services, or product component functionality. For more information, see Creating WebLogic Domains Using the Configuration Wizard. WLST Offline—a command-line scripting interface that you use to create a new domain or update an existing domain without connecting to a running WebLogic Server—supporting the same functionality as the Configuration Wizard. For more information, see ``WebLogic Scripting Tool.