# Transfer AS2 Connections

Learn how to make tested and working _AS2 Connections_ available in another Vault environment.


## About Transferring AS2 Connections Between Vault Environments

When adding an _<a href="/en/gr/703946/">AS2 Connection</a>_ to an agency or partner, the best practice is to create, configure, and test the connection in a non-production Vault first to ensure it has the correct settings, certificates, and list of allowed IPs. Once the _AS2 Connection_ is working correctly, you can transfer it to your Production Vault. This ensures that the connection works correctly once it is transferred to the correct Vault.

There are two (2) steps you must complete to transfer _AS2 Connections_ between Vaults:

* [Transfer Connections from the Source Vault][1]
* [Transfer Connections into the Destination Vault][2]

## Considerations

The following constraints apply when transferring _AS2 Connections_ between Vaults:

* Your organization must be the owner of both the source and destination Vaults.
* The source and destination Vaults must be in the same deployment region (for example, US-East-1).
* The source and destination Vaults must have the same release type (either Limited Release or General Release).

## Environment Transfer Status for AS2 Connections

An _AS2 Connection_ record's _AS2 Environment Transfer Status_ field indicates its current transfer status (if any) as described in the table below.

<div class="note-border alert-info">
  <div class="alert alert-info" role="alert">
    <div><i class="far fa-info-circle"></i></div>
    <div class="alert-text">
      <p><strong>Note</strong>: This field is set by Vault and is not editable.</p>
    </div>
  </div>
</div>



<table>
    <thead>
        <tr>
            <th>
                Environment Transfer Status
            </th>
            <th>
                Applicable Vault (Source or Destination)
            </th>
            <th>
                AS2 Connection Description
            </th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>
                <em>n/a (or blank)</em><a id="blank"></a>
            </td>
            <td>
                Source
            </td>
            <td>
                The connection has not been involved in any transfers.
            </td>
        </tr>
        <tr>
            <td>
                <em>Transferring Out</em><a id="transferring-out"></a>
            </td>
            <td>
                Source
            </td>
            <td>
                <p>
                    Vault is currently transferring the <em>AS2 Connection</em> to the destination Vault.
                </p>
                <p>
                    For <em>AS2 Connections</em> in this state, the following restrictions apply:
                </p>
                <ul>
                    <li>The connection's settings (including the <em>Connection Allowed List</em> records) cannot be edited.</li>
                    <li>The <em>Sync Connection to Gateway</em> action is not available.</li>
                    <li>You cannot upload Partner or Sponsor certificates.</li>
                </ul>
            </td>
        </tr>
        <tr>
            <td>
                <em>Transferred Out</em><a id="transferred-out"></a>
            </td>
            <td>
                Source
            </td>
            <td>
            <p>
                Vault has transferred the <em>AS2 Connection</em> to the destination Vault.
            </p>
            <p>
                For <em>AS2 Connections</em> in this state, the following restrictions apply:
            </p>
            <ul>
                <li>The connection's settings (including the <em>Connection Allowed List</em> records) cannot be edited, but can be deleted.</li>
                <li>The <em>Sync Connection to Gateway</em> action is not available.</li>
                <li>You cannot upload Partner or Sponsor certificates.</li>
            </ul>
            </td>
        </tr>
        <tr>
            <td>
                <em>Transferred In</em><a id="transferred-in"></a>
            </td>
            <td>
                Destination
            </td>
            <td>
                The <em>AS2 Connection</em> was transferred from a source Vault.
            </td>
        </tr>
        <tr>
            <td>
                <em>Transfer Canceled</em><a id="transfer-canceled"></a>
            </td>
            <td>
                Source
            </td>
            <td>
                A transfer action was initiated but was canceled before it was completed.
            </td>
        </tr>
    </tbody>
</table>


## Transfer Connections from the Source Vault

To transfer one (1) or more AS2 Connections from a source Vault to a destination Vault, navigate to **Admin > Connections** in the source Vault and then complete the steps in this section for each _AS2 Connection_ record you want to transfer to the destination Vault.

### Prerequisites

The following must apply for each _AS2 Connection_ in the source Vault you want to transfer:

* The connection must be in the _Registered_ state. \
    For more information on synchronizing an _AS2 Connection_, see <a href="/en/gr/01458/#synchronize-the-connection">Configure Custom AS2 Connections</a>.
* The connection's _AS2 Transfer Vault Domain_ field must contain the URL of the destination Vault. \
  For example, `https://<DestinationVault>.veevavault.com`, where `<DestinationVault>` is the name of the Vault to which you want to transfer the connection.
* The connection's _Environment Transfer Status_ field is set to one (1) of the following:
    * blank
    * _n/a_
    * _Transfer Canceled_
    * _Transferred In_

### Transfer Connections

Once each connection you want to transfer meets the above prerequisites, navigate to the _AS2 Connection_ record of one (1) of these connections and from the **All Actions** menu, select **Allow Transfer**.

If you are transferring more than one (1) connection, Vault confirms if you want to proceed with transferring all the connections that share the same _AS2 Transfer Vault Domain_. Select one (1) of the following options as required:

* **Cancel**: The transfer is canceled. No changes are made to any of the connection records.
* **Confirm**: Vault proceeds with transferring the connections, as described below.

**Result**

Vault sets the _AS2 Environment Transfer Status_ field of each of the connections being transferred to _[Transferring Out][4]_.

**Next Steps**

To complete the connections transfer, follow the steps described in [Transfer Connections into the Destination Vault][2].


### Cancel an AS2 Connection Transfer

To stop a transfer currently in progress on an _AS2 Connection_ in the source Vault, from the connection's **All Actions Menu**, select **Cancel Transfer**.

If there are other connections in the process of being transferred with the same _AS2 Transfer Vault Domain_, Vault asks if you want to cancel the transfer for all the connections. Select one (1) of the following options as required:

* **Cancel**: No changes are made to any of the connection records.
* **Confirm**: Vault proceeds with canceling the transfer of the selected _AS2 Connections_, as described below.

**Result**

Vault sets the _Environment Management Status_ field of the _AS2 Connection_ and any shared _AS2 Connections_ to [Transfer Canceled][8].


## Transfer Connections into the Destination Vault

Once you have [transferred connections from the source Vault][1], complete the following steps to pull the _AS2 Connections_ from the source Vault into the destination Vault:

1. In the destination Vault, navigate to **Admin > Settings > AS2 Connection Settings**.
2. In the **Transfer Connections** section, enter the URL of the source Vault, excluding the `https://` part of the URL. \
   For example,  `<DestinationVault>.veevavault.com.`
3. Select **Transfer AS2 Connections**.

**Result**

Vault performs the following actions for each of the transferred connections:

* Creates an _AS2 Connection_ record in the destination Vault for each _AS2 Connection_ record in the source Vault whose _AS2 Transfer Vault Domain_ field matches the URL of the destination Vault. Vault sets the _AS2 Vault Gateway State_ field of the _AS2 Connections_ records in the destination Vault to _Registered_.
* Sets the _AS2 Environment Transfer Status_ field of the transferred _AS2 Connections_ in the source Vault to _[Transferred Out][5]_.
* Sets the _AS2 Environment Transfer Status_ field of the transferred _AS2 Connections_ in the destination Vault to _[Transferred In][7]_.
* Sends a notification that the transfer process is completed. \
If one (1) or more _AS2 Connection_ records fail to transfer, Vault also sends a notification email.

[1]:#transfer-connections-from-the-source-vault
[2]:#transfer-connections-into-the-destination-vault
[3]:#blank
[4]:#transferring-out
[5]:#transferred-out
[6]:#transferring-in
[7]:#transferred-in
[8]:#transfer-canceled

