Creating Custom Configuration Migration Packages
This guide provides instructions on how to manually edit existing configuration migration packages (VPKs) to create custom VPKs. You can find instructions for creating and deploying Vault-generated VPKs in Vault Help
Prerequisites
Section link for PrerequisitesBefore you begin, ensure that you are able to change file extensions and zip and unzip files.
Changing the File Extension
Section link for Changing the File ExtensionAs a prerequisite to creating custom VPKs, you must be able to change the extension of files.
-
Enable file name extensions as follows:
-
Once it is visible, you can use Rename to change the file extension to
.vpkfor the package. Or, you can also use the terminal with the following command:
Extracting and Packaging VPK Content
Section link for Extracting and Packaging VPK ContentConfiguration migration packages (VPKs) are structured as ZIP archives, and their content can be extracted (unzipped) and packaged (zipped) with any conventional tool that handles .zip files. These steps are not required when working with Vault-generated VPKs that you do not wish to modify.
Extracting VPK Content
Section link for Extracting VPK ContentYou can extract VPK content by renaming the file from pkg_name.vpk to pkg_name.zip on your computer, and then unzipping the archive.
Packaging VPK Content
Section link for Packaging VPK ContentYou can package VPKs by creating a ZIP archive. VPKs must have at least one components folder or one javasdk folder (or both) to be a valid package. When all steps are ready to package, select the components folder, javasdk folder, and the vaultpackage.xml file and compress them into a .zip file. Then change the file extension from .zip to .vpk. Learn more about VPK contents.
Creating Your First Custom VPK
Section link for Creating Your First Custom VPKPerform the following steps to create a new Picklist component and deploy it with a VPK that you can import to any Vault:
-
Create a folder where you will build the VPK, for example,
my-first-vpk. -
In the
my-first-vpkfolder, create a folder calledcomponents. -
In the
my-first-vpk>componentsfolder, create a folder called00010. This folder represents the first deployment step. -
Open a new file in a text editor and paste the following MDL to create a Picklist component:
RECREATE Picklist my_first_picklist__c ( label('My First Picklist'), active(true), can_add_values(true), can_reorder_values(true), Picklistentry my_first_picklistentry__c( value('My First Picklistentry'), order(1), active(true) ) ); -
Save the file in the
my-first-vpk>components>00010folder asPicklist.my_first_picklist__c.mdl -
Open a new file in a text editor where we’ll create the MD5 Checksum file.
-
Generate the MD5 checksum for the
Picklist.my_first_picklist__c.mdlfile. -
Paste the MD5 checksum to the text editor, followed by a space and
Picklist.my_first_picklist__c, as shown below:<md5_checksum_value> Picklist.my_first_picklist__c -
Save the file as
Picklist.my_first_picklist__c.md5in themy-first-vpk>components>00010folder. -
Open a new file in the text editor and paste the following XML:
<vaultpackage xmlns="https://veevavault.com/"> <name>my-first-vpk-package</name> <source> <vault>999999</vault> <author>your.email@yourcompany.com</author> </source> <packagetype>migration__v</packagetype> <summary>My First VPK Package</summary> <description></description> </vaultpackage> -
Save the file as
vaultpackage.xmlin themy-first-vpkfolder. -
Select the
vaultpackage.xmlfile and thecomponentsfolder and create a ZIP archive from them with your preferred method. -
Change the extension of the file from
.zipto.vpk. -
Within Vault, import the VPK package
by navigating to Admin > Deployment > Inbound Packages and clicking Import. -
Deploy the VPK package
by clicking the imported package, clicking Review & Deploy, and following the on-screen instructions. -
Once the deployment is complete, verify the existence of the new picklist in Business Admin.
Troubleshooting Deployments
Section link for Troubleshooting DeploymentsWhen deploying VPKs, you may encounter errors and warning messages. The most common ones are documented in Configuration Migration Errors & Warnings