Export of the Notes, Attachments and Files.


Export Notes and Attachments

Below is an example of export.json that allows you to include Note and Attachment in the migration configuration.

Suppose you want to export Attachments and Notes related to Account records, including the binary data of the Attachments.

  objects: [
      {
          "operation": "Insert",
          "query": "SELECT Id, Name FROM Account"
      },
      {
          "operation": "Insert",
          "query": "SELECT Body, Id, Name, ParentId$Account FROM Attachment",
          "master": false
      },
      {
           "operation": "Insert",
           "query": "SELECT Body, Id, Title, ParentId$Account FROM Note",
           "master": false
      }
  ]
Notes:
  • ParentId$Account should be defined as a polymorphic field that binds the Notes and Attachments to the related Accounts.

  • For Attachments and Notes, the master property should be set to false to enable the automatic selection of related records.

  • If necessary, you can limit Attachment and Note records with a WHERE clause.

  • If your Attachments or Notes have large file sizes, to avoid script execution failure, we recommend reducing the restApiBatchSize for the Attachment/Note object to 5 - 10 (by default, it's set to 9500). Adjust this value to achieve clean migration results:

        //... 
        {
              "operation": "Insert",
              "query": "SELECT Body, Id, Name, ParentId$Account FROM Attachment",
              "master": false,
              "restApiBatchSize": 10
          }
        //...
    

Export Salesforce Files

You can export Salesforce Files (ContentVersions, ContentDocuments, etc.) using the core:ExportFiles Add-On.

Last updated on 15th Mar 2024