> 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/attach2dynamics/features/file-image-column-migration.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 cloud storages**. 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, Attach2Dynamics migrates the file to different cloud storages and updates the corresponding URL column with a clickable link. Users can continue accessing the document directly from the record.

{% 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 cloud storages.
  {% 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 the cloud storage.

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 Attach2Dynamics

After creating the required columns and updating the form, configure the entity in Attach2Dynamics.

1. Open Attach2Dynamics.
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 cloud storage**.
* The **Passport Document Link** field is automatically populated with a clickable cloud URL using the original file name.
* The file inherits the configured cloud folder permissions.

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

To verify the migration in your prefer cloud storage:

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 cloud** 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 cloud 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 **Attach2Dynamics > 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 cloud storages.
* The mapped URL column is automatically populated with a **clickable cloud 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.***
