Skip to main content

How to Back Up Existing docuWeaver Attachments to Another Storage Location

Updated over 2 weeks ago

Overview

  • docuWeaver provides several Apex actions to automate various document processes. For keeping backup your existing attachments from docuWeaver you can use the Apex action called “Copy to Storage”.

  • The Copy to Storage Apex action allows you to create a copy of your existing docuWeaver attachments stored in one of the following locations to another supported storage location:

    • Amazon S3

    • Azure

    • SharePoint

    • External Salesforce org

    • Google Drive

  • This process does not preserve the record–file association.

Pre-requisites

  1. The required storage profile for storing copied attachments files must be created in advance.

  2. Ensure the running user has access to the Apex Action through the appropriate profile or permission set.

Flow Configuration Steps

  1. Open Flow Builder and add an Action element after your desired step (e.g., trigger or screen).

  2. Search for and select your Apex action method (e.g., "Copy to Storage").

  3. Map Flow variables or static values to input parameters (for example, provide multiple comma separated source attachment Ids, assign the record Id, specify the base path, and other settings).

  4. Under Advanced > "Manually assign variables", store outputs in a Flow variable (e.g., collection for List<Result>).

  5. Connect to next elements and activate/debug the Flow.​​

Test in a Screen Flow or Record-Triggered Flow.

Refer to the Apex Action Documentation for detailed input parameters, including Template Name, Record ID, and optional settings.

Note:

Migration/Copying Files depends on the heap size limits provided by Salesforce. Although Salesforce provides a standard heap size 12 MB limit for migrations, files that are close to this limit cannot be migrated reliably because other Salesforce processes also consume a significant portion of heap memory due to governor limits.

Additionally, there are file size limitations based on the storage server being used, as each storage provider processes files differently and consumes heap memory accordingly. For example, when migrating files to Amazon S3, files up to 8-9 MB per file can typically be migrated. However, this limit may vary depending on the storage server in use.


Did this answer your question?