Migrating Templates, Redline Requests and Sign Documents between orgs

What actually needs to move

3B stores every configured artifact as a record plus one or more files. The record holds settings and status. The definition itself lives in a file (a ContentVersion) linked to that record. A migration is not complete until both the record and its linked files are recreated in the target org.

Definitions are stored in files with fixed names:

File name Holds Attached to
Template.3bt The compiled Template definition (body, inputs, settings) Template__c
PDFConfig.3bt The Sign field layout over the uploaded PDF Document__c
Document.html A completed or in-progress document body Document Trace / Redline Request
Document.pdf The final rendered PDF Document Trace / Submission Request / Redline Request
Signature.json / Signature.png Captured signatures signer records

Files are matched by their title (file name), not by a typed field. A data loader recreates a file by inserting a ContentVersion, then linking it to the parent record with a ContentDocumentLink.

The identity fields that make migration safe

Front-end links, sub-template references, and render URLs resolve a template by a stable identifier, not by the Salesforce record Id. Preserve these on migration so existing links keep working:

Universal load order

Because several child objects are master-detail, order is strict. For any artifact:

  1. Insert the parent records first. Capture the old Id to new Id mapping.
  2. Insert the ContentVersion rows (Title, PathOnClient, VersionData, and Identifier__c where present). Either set FirstPublishLocationId to the new parent Id to auto-create the first link, or insert the version standalone and create links in step 3.
  3. Insert the ContentDocumentLink rows: resolve each ContentDocumentId from the inserted version, and link it to the new parent (LinkedEntityId) with share type Inferred and visibility All Users.

The All Users visibility is not optional. Guest signers, community users, and the rendering service all read these files as external contexts. A file linked without All Users visibility will appear missing to them.

Before loading, on your data-loader user only, you can set the trigger kill-switches in General Settings (Disable_Template_Trigger__c, Disable_ContentVersion_Trigger__c, Disable_Document_Trace_Trigger__c, Disable_Query_Trigger__c) to avoid firing automation during import. Note the Identifier auto-issue lives in those triggers, so if you disable them you must pre-populate Identifiers yourself. Clear the switches when done.

Migrating a Template

Move, in order:

  1. Shared library records the template references (these are org-wide singletons keyed by Name, migrate first and remap lookups):
    • Template_Style__c (the Body__c CSS) - referenced by the template's style lookup.
    • Value_Formatter__c (Name, Formatter__c) - matched by Name.
    • Function_Expression__c (Name, Function__c) - matched by Name.
  2. Sub-templates: any Template__c with Use_As_Subtemplate__c = true that the parent embeds. Migrate the record plus its Template.3bt, and preserve their Identifiers (the parent body references them by Identifier).
  3. The Template record (Template__c) including Identifier__c, the Template_Style__c lookup (remapped), Core_Object__c, and its setting flags.
  4. The Template.3bt ContentVersion plus its link to the template.
  5. Any other uploaded resources on the template (images and similar) - these are additional ContentDocumentLinks with titles other than Template.3bt.

The in-org Clone Template action does exactly this internally (it clones the record, the latest Template.3bt, and re-points every resource link), which confirms what a template "is". The one difference: cloning issues a new Identifier, whereas migration keeps the existing one.

Migrating a Sign Document

  1. The Document__c record including External_Id__c, Core_Object__c, Slug__c, Status__c, and submitter count fields.
  2. The PDFConfig.3bt ContentVersion (the field layout) plus its link. The flattened source PDF and any generated Document.pdf / Document.html are also versions on the document.
  3. Only if migrating in-flight submissions, and in this strict master-detail order: Document__c -> Submission_Request__c -> Submitter__c.

For template-only migration (moving the reusable Sign document without live submissions), stop after step 2.

Migrating a Redline Request

Redline_Request__c is a child (master-detail) of Template__c, and Collaborator__c is a child of both Redline_Request__c and Contact. So both parents must exist first.

Load order:

  1. Contact records for the collaborators, and the Template__c (migrated per the Template section, including Template.3bt).
  2. Redline_Request__c including Record_Id__c, Status__c, Data_Version_ID__c (pins the version), and Completed_Document_Link__c.
  3. Collaborator__c including Order__c, Status__c, Magic_Link__c, Data_Version_ID__c, permission flags, and Slug__c.
  4. ContentVersions for the request's Document.html / Document.pdf, then their ContentDocumentLinks.

Do not forget General Settings

General Settings is a hierarchy custom setting, not an artifact. It does not travel with the records. Configure it in the target org (PDF service URLs, files endpoint, Sign endpoints and auth token) or generation and rendering will fail. See General settings and org configuration.

Checklist