**Source URL:** https://general.veevavault.dev/safety/vault-toolbox/intellij-plugin/guides/comparing-vaults.md

# Comparing Vaults

The Vault Toolbox plugin allows you to compare MDL and Vault Java SDK components between two Vault environments. This guide outlines how to run a comparison, review the differences, and apply changes from one Vault to another.

## Running a Comparison {#running-a-comparison}

To compare two Vault environments:

<Steps>
1. Within IntelliJ IDEA, open the Vault Toolbox plugin from the righthand sidebar.

2. Select the **Actions** (<Icon name="ph:sliders-horizontal"></Icon>) tab.

3. Expand **Components** (<Icon name="ph:puzzle-piece"></Icon>) and double-click **Compare Environments** (<Icon name="ph:caret-double-right"></Icon>).

4. In the dialog, click **Sign In** next to **Source** to authenticate to the source Vault. See [details on the available authentication methods](/vault-toolbox/intellij-plugin/guides/authentication).

5. Click **Sign In** next to **Target** to authenticate to the target Vault. The source and target environments must be different.<ThemeImage srcLight="/images/toolbox/intellij-plugin/compare_environments_light.png" srcDark="/images/toolbox/intellij-plugin/compare_environments_dark.png" alt="IntelliJ Plugin Compare Environments"></ThemeImage>

6. Optional: Click **⇅ Swap** to swap the source and target vaults.

7. Select the comparison types to include: **MDL** for component definitions and/or **SDK** for Vault Java SDK source code. You must select at least one type.

8. Optional: For MDL, select a filter from the dropdown to narrow results by Vault naming convention: **All**, **Custom (`__c`)**, **Standard (`__v`)**, **System (`__sys`)**, or **Other (`__vs`, `__rim`, …)**.

9. Click **Compare** to run the comparison. Click **Stop** to cancel a comparison while it's running.

</Steps>
A progress bar displays while Vault Toolbox downloads components from both environments. Once the comparison is complete, the status bar reports the number of files compared and the number of differences found.

## Reviewing Differences {#reviewing-differences}

After a comparison completes, results appear in a tree grouped by comparison type and component type. Each entry is assigned one of the following statuses, indicated by color:

* <span style="color:#af7c2f">**Modified**</span>: The file exists in both Vaults with different content.

* <span style="color:#46c16d">**Source Only**</span>: The file exists in the source Vault but not the target.

* <span style="color:#c75656">**Target Only**</span>: The file exists in the target Vault but not the source.

* <span style="color:#7e8081">**Identical**</span>: The file exists in both Vaults with identical content.

Select a file in the tree to view a side-by-side differences in the right panel. To view the results in a different format, you can select **Raw MDL View** or **Semantic JSON View** from the dropdown.

To filter the results, you can use the **Filter** dropdown to show **Differences Only**, **All Files**, **Modified**, **Source Only**, or **Target Only**. Additionally, you can use the search bar (<Icon name="ph:magnifying-glass"></Icon>) to narrow the tree by file name.

## Applying Changes {#applying-changes}

You can apply individual differences from the source Vault to the target, or from the target Vault to the source, directly from the comparison results. This action is irreversible from Vault's perspective. Vault Toolbox writes a local backup of the original file so you can revert the change while the dialog is open, but closing the dialog discards all backups.

<Aside type="caution">Applying changes deploys MDL or SDK directly to a connected Vault. Apply changes is blocked on production Vaults to prevent accidental modifications.</Aside>
To apply a change:

<Steps>
1. After running a comparison, select the **Enable Apply Changes** checkbox above the results tree to enable the action buttons. A confirmation dialog appears warning that applied changes are irreversible.

2. Select a file in the results tree.

3. Click **Source to Target**<Icon name="ph:caret-right"></Icon> to deploy the source version to the target Vault, or <Icon name="ph:caret-left"></Icon>**Target to Source** to deploy the target version to the source Vault.<ThemeImage srcLight="/images/toolbox/intellij-plugin/apply_changes_light.png" srcDark="/images/toolbox/intellij-plugin/apply_changes_dark.png" alt="Applying Changes after Comparing Vaults"></ThemeImage>

4. Optional: To undo a recently applied change while the dialog is still open, select the file and click <Icon name="ph:arrow-u-up-left"></Icon> **Revert**. Revert restores the affected Vault from the local backup taken when the change was applied.

</Steps>
A banner appears at the top of the differences panel indicating which files have been applied. Closing the *Compare Environments* dialog permanently deletes all backup files, making applied changes irreversible from this dialog.



---

**Previous:** [Working with Custom MDL](/safety/vault-toolbox/intellij-plugin/guides/working-with-components)  
**Next:** [Designing & Deploying Custom VPKs](/safety/vault-toolbox/intellij-plugin/guides/designing-deploying-custom-vpks)