π¦ What is a 2Pack in iDempiere?
A 2Pack in iDempiere is a powerful packaging mechanism that enables easy configuration management across environments.
A 2Pack allows you to export and import application metadata and configuration (such as windows, processes, tables, reports, and even data) between different iDempiere environments.
Think of it as a "configuration snapshot" that can be easily transferred and applied to different iDempiere instances.
π― Purposeβ
2Packs are used to:
- Transfer configurations between development, test, and production environments
- Distribute customizations as part of plug-ins
- Automatically initialize or update application components when deploying a plug-in
π§© What Can Be Included?β
A 2Pack can include the following elements:
| Type | Description |
|---|---|
| Windows / Tabs / Fields | Entire UI components |
| Processes / Reports | Custom processes or Jasper reports |
| Tables / Columns | Custom database structures |
| Roles / Menus / Messages | Security settings and localization |
| SQL Scripts | Executed automatically during Pack In |
| Dynamic Validations | Input validation rules |
| Print Formats / References | Custom documents and reference data |
| Arbitrary Data | Any row from any table using SQL |
π Key Conceptsβ
- Pack Out: Export configuration and/or data into a
.zipfile - Pack In: Import the
.zipfile into another iDempiere environment
The .zip file contains an XML manifest and associated data files.
βοΈ How It Worksβ
π Step-by-Step Workflowβ
- Define Package: Developers define a Pack Out package using the iDempiere UI
- Generate Archive: 2Pack generates a
.zipfile with all the selected metadata and data - Deploy Package: The
.zipcan be imported using multiple methods:
Import Methodsβ
Manual Import
- Use the Pack In window in iDempiere UI
Automated via Plug-ins
AdempiereActivator: Basic activationIncremental2PackActivator: Advanced activation with version control
Automatic External Pack In
- iDempiere automatically scans a configured folder for
.zipfiles - Installs them automatically on startup
- Perfect for automated deployments and containerized environments
Use Automatic External Pack In for CI/CD pipelines and Docker deployments to achieve zero-touch configuration updates.
π οΈ File Naming Conventionsβ
Standard 2Pack Namingβ
For general use, 2Pack files are typically named using a descriptive format:
2Pack_1.0.0_MyPlugin.zip
Automatic External Pack Inβ
If you use the Automatic External Pack In feature, you must follow a specific naming convention for iDempiere to automatically detect and process your 2Pack files.
Required Format:
[Timestamp]_[ClientValue]_[AdditionalInformation].zip
Components:
- Timestamp: Format
YYYYMMDDHHMM(Year, Month, Day, Hour, Minute) - ClientValue: The client identifier (e.g.,
SYSTEM,GardenWorld) - AdditionalInformation: Descriptive name for the pack
Example:
201803161725_SYSTEM_CreateNewColumn.zip
Use descriptive names for the AdditionalInformation part to make it easy to identify what the 2Pack contains, especially when managing multiple packs.
β Benefitsβ
- Enables consistent configuration across systems
- Automates initial setup for plug-ins
- Reduces risk of manual errors
- Cleanly separates code from configuration
- Works with version control and CI/CD
2Pack is an essential component for working with iDempiere in a professional and scalable way. It's the foundation for maintainable, enterprise-grade iDempiere deployments.
π Whatβs Next?β
Now that you understand what a 2Pack is, read the next section to learn step-by-step how to create and import 2Packs in your own plug-ins or iDempiere environments.