> For the complete documentation index, see [llms.txt](https://docs.flosum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flosum.com/backup-and-archive/restore/how-to-guides/how-to-restore-archived-cases-with-emails-and-file-attachments.md).

# How to Restore Archived Cases with Emails and File Attachments

## ![](https://646917531-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Focom3JROuDKOidclKbQx%2Fuploads%2Fgit-blob-3f6faa4230b72167926fbc0a31dd17dc7d74581d%2FSummary2-Small-Icon.svg?alt=media) Overview

Restoring archived objects that include emails and file attachments requires properly archiving the original case objects along with their related emails and files. This guide details the process of successfully archiving and restoring **Case** objects containing **Emails** and **file attachments** using the Backup & Archive application.

{% hint style="info" %}
The article uses the **Case** object as an example, but any object with an email and a file can be used.
{% endhint %}

### Prerequisites

The following conditions are required to complete the instructions in the article. Each is explained in more detail in the sections below.

* [#create-archive-template-for-emails-and-file-attachments](#create-archive-template-for-emails-and-file-attachments "mention")
* [#assign-the-update-email-messages-permission](#assign-the-update-email-messages-permission "mention")

To complete this example, ensure you are familiar with the following actions in Backup & Archive:

* Create an Archive: [Creating a Templated Archive](/backup-and-archive/backup-and-archive/archives/creating-a-templated-archive.md)
* Create Restore Job: [Creating an Archive Restore Job (Preparation)](/backup-and-archive/restore/prepare-restore/creating-an-archive-restore-job-preparation.md)
* Execute Restore Job: [Running a Restore Job (Execution)](/backup-and-archive/restore/execute-restore/running-a-restore-job-execution.md)

## Create Archive Template for Emails and File Attachments

To ensure all related records and attachments are archived and restorable, the archive template must be configured with proper parent-child relationships. See the basic structure below, along with a screenshot of an example Archive Template.

* **Case** - Parent Object
  * **Content Document** - Files related to the Case object
  * **Email Message** - Emails related to the Case object
    * **Content Document** - Files related to the Email Messages object

<div align="left"><figure><img src="https://646917531-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Focom3JROuDKOidclKbQx%2Fuploads%2FL1zqoKFEperCUbflHOsv%2FHowToRestoreArchivedEmailAndFile-Archive-01.png?alt=media&amp;token=96f44c3e-d023-4533-bd39-e894fe078ce8" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="warning" %}

#### Important

Files attached to **Email Message** objects appear in the **Case** object's Files related list due to the internal **Combined Attachment** object. Here are key points to note:

* **Not Directly Related:** The **Combined Attachment** object is not directly related to the **Case** object.
* **API Restrictions:** It is not queryable or restorable via API.
* **Restore Caution:** If you don't include the **Content Document** object under **Email Message** in the archive template, email attachments will neither be backed up nor restored.
  {% endhint %}

## Assign the “Update Email Messages” Permission

Restoring Email Messages with attachments requires the user performing the restore to have the **“Update Email Messages”** system permission. This is necessary to re-establish relationships between EmailMessages and files, and to update fields such as To, From, Cc, Bcc, and ContentDocument references. Follow these steps:

1. Log in to your Salesforce org.
2. Go to **Setup**
3. In **Quick Find**, search for **Permission Sets.**
4. Click **New** or open an existing permission set.
5. Navigate to **System Permissions.**
6. Click **Edit.**
7. Search for **Update Email Messages** and check the box.
8. Click **Save.**
9. Click **Manage Assignments** > **Add Assignments.**
10. Select the user who is used to connect your Salesforce org with your Flosum Cloud Apps.
11. Click **Assign.**

{% hint style="warning" %}

#### What happens without the Update Email Messages permission?

* Email records and files may be restored, but:
  * **ContentDocumentLink** relationships will not be restored.
  * **Attachments** will not appear in the related list of the restored EmailMessage.
  * Files may still exist in Salesforce, but will not be accessible from the restored email.
    {% endhint %}

## View Restored Emails and Attachments

To verify restored records:

1. Navigate to the restored **Case** record
2. In **Activity History**, find the restored email
3. Open the **EmailMessage** record
4. In the **Related** section, click on **Attachments**
5. Files attached to the email will appear here

{% hint style="warning" %}

### Why are restored email attachments not appearing on the Attachments page?

* The Notes & Attachments section uses the **CombinedAttachment** object.
  * This object cannot be created or restored via the API. (Salesforce Limitation)
  * Restored files won’t be shown in the Notes & Attachments section.
* Images are **Embedded** in the email body.
  * Embedded images are stored through CaseFeed, which is not creatable/updatable via API. (Salesforce Limitation)
  * The images are restored as files, but won’t render inline in emails.
    {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flosum.com/backup-and-archive/restore/how-to-guides/how-to-restore-archived-cases-with-emails-and-file-attachments.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
