> For the complete documentation index, see [llms.txt](https://docs.inogic.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inogic.com/sharepoint-security-sync/features/configuration-for-moving-copying-email-body-content-1.md).

# File & Image Column Migration

The **File & Image Column Migration** feature allows you to automatically move files uploaded to **Dynamics 365 File and Image columns to SharePoint**. This helps reduce Dataverse storage usage while keeping documents easily accessible from Dynamics 365.

When a user uploads a file or image to a configured column, SharePoint Security Sync migrates the file to SharePoint and updates the corresponding URL column with a clickable link. Users can continue accessing the document directly from the record, while the file inherits the configured SharePoint folder security.

{% hint style="info" %}
**Note**:

* Before using **File and Image Migration**, create a corresponding **URL** column, add the **File and Image Control component**, and map the URL column to the respective **out-of-the-box (OOB)** or custom File/Image column in the **File/Image Column Configuration tab**.
* Files uploaded through the **File and Image Control** are migrated automatically when the Attachment Action is set to **Move** or **Copy**.
* If a file is uploaded directly to an **OOB** or **custom File/Image column**, or if the Attachment Action is Blank, run a **Bulk Migration Job** to migrate the file to SharePoint.
  {% endhint %}

The following steps walk through this configuration using the Contact entity as an example.

### Step 1: Create a File Column

1. In the Power Apps interface, select **Tables** from the left navigation menu.
2. Select the **Contact** table and click **Columns** under the Schema section.

<figure><img src="/files/nc6Gt0kJLN4G2UYziXn5" alt=""><figcaption></figcaption></figure>

3. Click **+** **New column**.
4. In the New column properties pane:

* Enter **Passport Document** in the Display name field.
* Set the Data type to **File**.

<figure><img src="/files/CqJ9rC9HzOpQAyZYqcDo" alt=""><figcaption></figcaption></figure>

5. Click **Save**.

<figure><img src="/files/lfimC35xhyp6qdNgAowv" alt=""><figcaption></figcaption></figure>

### Step 2: Create a URL Column

To migrate a File or Image column, a corresponding URL column must be created. This column will hold the hyperlink to the migrated file once it is moved to SharePoint.

1. Click **+ New column** again to create a second column.
2. In the New column properties pane:

* Enter **Passport Document Link** in the Display name field.
* Set the Data type to **Single line of text**.
* Set the Format to **URL**.

<figure><img src="/files/8oDPhgOIypu0IHK0yJW8" alt=""><figcaption></figcaption></figure>

3. Click Save.

### Step 3: Add the Fields to the Contact Form

1. Go to **Tables > Contact > Forms**.
2. Open the Contact form with Form type **Main** in the form designer.

<figure><img src="/files/RtTisf3ymONZSW8HCSjD" alt=""><figcaption></figcaption></figure>

3. In the **File and Image tab**, navigate to the **Personal Details** section.
4. Add both the **Passport Document** and **Passport Document Link** fields to this section.

<figure><img src="/files/fBlQYgBfCjkzeDSTXXta" alt=""><figcaption></figcaption></figure>

### Step 4: Add the Custom Component to the URL Field

1. Select the **Passport Document Link** field on the form **canvas**.
2. In the properties pane, expand the Components section and click **+ Component**.

<figure><img src="/files/s6KXTvK8AW3ryog3aaUO" alt=""><figcaption></figcaption></figure>

3. Click **Get more components**.

<figure><img src="/files/rAijgTd8CIrqVUkRqQ9A" alt=""><figcaption></figcaption></figure>

4. From the list of available components, select **File and Image Control** and click **Add**.

<figure><img src="/files/3meR9n5wIaymphIckIVw" alt=""><figcaption></figcaption></figure>

### Step 5: Configure the Custom Component

1. In the Add **File and Image Control configuration pane**, set the following:

**Column Logical Name (File or Image)**: Enter the logical name of the File or Image column, for example, cree7\_passportdocument.

{% hint style="info" %}
**Note**: This must be the logical name of the File or Image column, not its display name.
{% endhint %}

<figure><img src="/files/5tyZ0ZBpFinGORoev4za" alt=""><figcaption></figcaption></figure>

**Column Type**: **file or image**: Enter file if the column type is File, or image if the column type is Image.

2. Ensure the component is enabled for **Web, Mobile, and Tablet**.
3. Click **Done**.

### Step 6: Save and Publish

Click Save and Publish in the form designer to apply the changes to the environment.

<figure><img src="/files/D595lv0OMr3yBUWtraj7" alt=""><figcaption></figcaption></figure>

### Configure File & Image Migration in SharePoint Security Sync

After creating the required columns and updating the form, configure the entity in SharePoint Security Sync.

1. Open **SharePoint Security Sync**.
2. Select **Entity Configurations**.
3. Open the **Contact entity configuration**.
4. Navigate to the **File/Image Column Configuration tab**.
5. Locate the **Passport Document field**.
6. From the **URL** dropdown, select **Passport Document Link**.

<figure><img src="/files/fUel44HEvuvAqhpOpy4o" alt=""><figcaption></figcaption></figure>

7. Click **Save Config**.
8. Save the **entity configuration**.

### Verify the Expected Result

After completing the configuration, verify that the uploaded file has been migrated successfully.

1. Open a **Contact record**.
2. Navigate to the **File and Image tab**.
3. Upload a file to the **Passport Document field**.
4. Save the **record**.

<figure><img src="/files/z5UrJ2DcE4WzwzjpAD8N" alt=""><figcaption></figcaption></figure>

After the background migration completes:

* The uploaded file is moved from **Dataverse to SharePoint**.
* The **Passport Document Link** field is automatically populated with a clickable SharePoint URL using the original file name.
* The file inherits the configured SharePoint folder permissions.

<figure><img src="/files/n5Ob91GulKVmD9RQFwQW" alt=""><figcaption></figcaption></figure>

To verify the migration in SharePoint:

1. Open the **Attach2Dynamics panel** for the Contact record.
2. Confirm that the uploaded file appears in the document list.
3. Click **Open Folder in SharePoint** to verify the file location.

<figure><img src="/files/7YNpyr7Yd4NBme0DSs1o" alt=""><figcaption></figcaption></figure>

### Bulk Migration Job

Files uploaded directly to an **out-of-the-box (OOB)** or **custom** File/Image column are not migrated to SharePoint automatically. To migrate these files, run a **Bulk Migration Job**.

{% hint style="info" %}
**Note:** Before running the Bulk Migration Job, ensure that the File/Image column is mapped to its corresponding **URL** column in the **File/Image Column Configuration** tab of the Entity Configuration.
{% endhint %}

#### Step 1: Initial Upload

Before uploading a file, the File/Image column is empty.

<figure><img src="/files/akeHkHOcX1zwwmdzVo4I" alt=""><figcaption></figcaption></figure>

#### Step 2: Upload a File

Upload a file to the OOB or custom File/Image column and save the record. The file remains in Dataverse until the Bulk Migration Job is executed.

<figure><img src="/files/6abA9GoyQ43bpKza7HyC" alt=""><figcaption></figcaption></figure>

#### Step 3: Run the Bulk Migration Job

1. Navigate to **SharePoint Security Sync > Bulk Migration Jobs**.
2. Create a new Bulk Migration Job.
3. Set **Migrate** to **File and Image**.
4. Set **Attachment Action** to **Move**.

<figure><img src="/files/1l2cO46Tm85scM9eluz4" alt=""><figcaption></figcaption></figure>

5. Save the job.

#### Step 4: Verify the Migration

After the Bulk Migration Job completes successfully:

* The physical file is moved from Dataverse to SharePoint.
* The mapped URL column is automatically populated with a **clickable SharePoint link**.

<figure><img src="/files/b9RXIR5ifc9xMDL8jrmT" alt=""><figcaption></figcaption></figure>

* You can verify the migration status from the **Job Status** tab of the Bulk Migration Job record.

<figure><img src="/files/2xF26DVcEal9E3RMKJRR" alt=""><figcaption></figcaption></figure>

[***Click here***](https://docs.inogic.com/sharepoint-security-sync/features/bulk-migration-job) ***to know more about Bulk Migration Job.***
