The Configuration of Commerce Server is stored in SQL Server database using Configuration APIs to manage it. To generate Commerce Server configuration you can use either the APIs or pre configured files. PUP which stands for Packaging and Unpackaging is used to create Commerce Server sites and resources. In this post I hope to shed some light on how Commerce Server PUP works.
Site Packager application (Pup.exe) is a tool that packages or unpackages Commerce Server sites and resources into PUP files.
The Commerce Server documentation states that PUP is a deployment tool. I disagree, you should avoid deploying Commerce Server site from one environment to another. I use PUP is to manages the creation or extraction of Commerce Server sites or resources.
Is PUP the only way to create and extract Commerce Server Sites? No, you can use Commerce Server's Configuration APIs to do the same thing and I will show you how to do that. There has been some great post about PUP which you can find at the bottom for further reading.
PUP is responsible for the following operations:
The Site Packager application can be used in two modes unattended\console and UI based. Using Site Packager application you can also add additional resources or Commerce Server Applications. PUP.exe will generate a log file under c:\pup.log and will append it's data for every execution of packages.
PUP stores and extracts it's data when unpackaging and packaging into MSCS_Admin database. For now we will concentrate on PUP and at later posts we dive deeper into MSCS_Admin database and Configuration API's.
When launching the PUP.exe you will navigate through the UI forms. Each form collects specific data then generates a Commerce Server Site or resource based on your responses and the data inside the PUP file.
Once the PUP.exe is launched you have two options Packaging an existing site or Unpackaging for a PUP file.
If you select the Unpackage a PUP file you will navigate to next wizard form. On this form you need to enter the path of the PUP file and select either a Quick Unpack or Custom Unpack.
To launch the PUP.exe you must supply it two answer files. The answer files are ini files that holds responses to how the pup file should generate a Commerce Site.
The site packager .ini file control how a PuP file is deployed when you silently launch PUP. It is the answer file to all the Commerce Server System except Profiles System for that you will need BizData.ini.
The BizData.ini file is the answer file to Profiles System data related to a site. PUP.exe will look into the root folder (%COMMERCE_SERVER_ROOT%) of where Commerce Server is installed. So if you have customized the Profiles System then you need to put all the SQL, XML files and BizData.ini in this %COMMERCE_SERVER_ROOT% directory.
To automate the PUP process you will need an ini file. The ini file is an answer file to pup process and a sample ini can be found under %COMMERCE_SERVER_ROOT%\Sdk\Samples\SiteCreate\CSharpTemplate.ini.
Command line to pack a site:
pup /p /s:BlankSite /f:C:\Program Files\Microsoft Commerce Server 2007\PuP Packages\YourSite.pup /i:C:\Program Files\Microsoft Commerce Server 2007\PuP Packages \YourSite.ini
Command line to unpack a site:
"C:\Program Files\Microsoft Commerce Server 2007\PuP.exe" /u /f:C:\Program Files\Microsoft Commerce Server 2007\PuP Packages\CSharp.pup /i:C:\Commerce\CSharp.ini
For more information and command line option see online help How to Run Site Packager from the Command Line.
PUP files are Structured Storage. Structured Storage provides file and data persistence in COM by handling a single file as a structured collection of objects known as storages and streams. So PUP.exe generate a Structured Storage file then puts it's site and resource data into it. The Site and Data is further structured inside Cab files. To keep this structure formalized a table of content keeps track of what's inside the PUP file. To create Cab file Cabarc.exe is used under the root of where Commerce Server is installed.
diagram of PUP file structure:
There are three PUP files that are installed with Commerce Server blank PUP, CSharp PUP and DW PUP.
This PUP file is used when you generate a Commerce Site using Visual Studio.
Generates a blank C# Site.
Data warehouse resource is stored in the PUP file.
You need to be a domain administrator to execute the PUP.exe. Remember the PUP file has the structure of the Commerce Server Systems so it needs to be able to hit SQL and create databases and SQL objects. It also needs to access IIS metabase information and create IIS sites or Virtual Directory. Not to include creating a pup file under the c:\ drive. If I can remember correctly remote PUP support was removed for Commerce Server 2007.
PUP can launch a script for Pre and Post operations. The script must be in the same directory as the PUP file and must be named Pre<package name>.vbs or Post<package name>.vbs.
Backward compatibilty of PUP file are supported but you can read more about it Migration Impact on Pup Files here.
So you should have a good understanding of PUP.exe in the next blog post we will take a deeper dive into PUP. In another words we will flay PUP :).
Packaging and Unpacking Commerce Server Sites through PUP Package
Deploying Commerce Server 2007 Sites without Site Packager