Pack and Unpack Command in Oracle Weblogic

WebLogic Domains containing manage servers can be extended to different servers. To do this, weblogic comes with  the  pack and unpack tools. The tools are located at

 

11g

$MW_HOME\wlserver_10.3\common\bin

12c

$MW_HOME\wlserver\common\bin

PACK Command

The pack command creates a template archive (.jar) 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.

 

When you create this type of template . . The following occurs . . .
Domain

All files and directories in the source 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 domain, such as DefaultAuthenticatorInit.ldift and XACMLRoleMapperInit.ldift.

 

Note: If you configured additional security data, such as for users, groups, or roles, through the 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 domain.

 

Managed Server (using the -managed=true option)

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 domain
  • bin directory
  • lib directory
  • All files and subdirectories in the config directory

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

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

 

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.

 

Example

pack -domain=/d0/oracle/middlware/user_projects/domains/mydomain -template=/d0/oracle/middlware/user_templates/mydomain.jar -template_name="My WebLogic Domain"

 

 

UNPACK Command

Creates a full domain or a subset of a domain used for a Managed Server domain directory on a remote machine. You may use unpack only with a template compatible with your current installation. The template can be any of the following:

 

  • A domain template provided by BEA and packaged with your current installation
  • A domain template created using the Domain Template Builder or WLST Offline
  • A domain template created using the pack command
  • A Managed Server template created using the pack command. A Managed Server template, by default, contains only the files necessary for creating a Managed Server domain directory.

 

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
  • A config_bootstrap.xml file (based on the config.xml in the template)
  • A nm_password.properties file
  • A SerializedSystemIni.dat file

Example

 

unpack -template=/d0/oracle/middleware/user_templates/mydomain.jar -domain=/d0/oracle/middleware/user_projects/domains/my_new_domain

 Reference