Skip to content

Migrate Component Configuration

Vault's Admin UI provides a very robust way for configuration migration using VPK packages. You can also create your own VPKs to perform a specific set of changes. However, it may be necessary to automate migration or synchronization of certain components programmatically. For successful migration, it is necessary to first describe the component on the source Vault and generate a RECREATE command. You can execute this command on the target Vault.

Let’s again use Notification Template as an example. We will migrate my_template1__c from a source Vault to a target Vault.

First generate a RECREATE command on a source Vault. Ensure that the session ID used to authenticate the API call is generated by authenticating to the source Vault.

curl -X GET \ https://{sourceVault}.veevavault.com/api/mdl/components/Notificationtemplate.my_template_1__c \ -H 'Accept: application/json' \ -H 'Authorization: {sourceVaultSessionId}'

This generates a RECREATE command for Notificationtemplate.my_template_1__c

RECREATE Notificationtemplate my_template_1__c ( label('My Template 1'), active(true), description(''), referenced_component(), subject('My Subject'), notification('My notification test'), email_body('My email body'), entity_type('document') );

You can then execute this command on the target Vault using the session ID generated from authenticating to the target Vault.

curl -X POST \ https://{targetVault}.veevavault.com/api/mdl/execute \ -H 'Accept: application/json' \ -H 'Authorization: {sourceVaultSessionId}' \ -d 'RECREATE Notificationtemplate my_template_1__c ( label('My Template 1'), active(true), description(''), referenced_component(), subject('My Subject'), notification('My notification test'), email_body('My email body'), entity_type('document') );'