# Backing Up Your Project to Version Control

{% hint style="info" %}
The **CI JOBS** screen is easiest to read at **80 %** zoom in Chrome or Firefox.
{% endhint %}

### Overview <a href="#overview" id="overview"></a>

Use ARM to back up changes from your Salesforce org to your [version-control](https://www.autorabit.com/blog/8-benefits-of-version-control-in-salesforce-development/) system. You can also map commits to specific Salesforce users.

### Procedure <a href="#procedure" id="procedure"></a>

1. Log in to ARM.
2. From the top navigation bar, select **`Create New > New CI Job`**.

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FHeJZC8Zbc5apBs08iLJS%2Fimage.png?alt=media&#x26;token=48f13e49-3071-4faf-9223-e47f5026f65d" alt="Create New > New CI Job menu option"><figcaption><p>Create New CI Job</p></figcaption></figure>
3. Click the **Backup to Version Control** tile.

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FR898nJMfCf4SQ2Cm0yz9%2Fimage.png?alt=media&#x26;token=1366232f-bc14-4f51-82c8-305f09c18e91" alt="Backup to Version Control job tile"><figcaption><p>Backup to Version Control</p></figcaption></figure>
4. Enter a descriptive **Job name**.
5. Add a short **Description**.
6. (Optional) Assign the job to a **Group** for easier filtering, or click **`+`** to create a new group.
7. The configuration page is divided into several sections. The key sections are explained below.

#### Build <a href="#build" id="build"></a>

Under **Build**, provide:

1. **Source Salesforce org** – The org to back up.
2. **Package type** – How ARM collects metadata:

   * **Unpackaged mode** – Retrieves metadata changed since the last ARM cycle (or since **Start date**, if specified).
   * **Unmanaged package** – Retrieves components from an unmanaged package so you can edit them.
   * **Managed package** – Retrieves components from a managed package created in a partner dev org.

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FDksO707uZdvXzeWDfefX%2Fimage.png?alt=media&#x26;token=2286d130-105b-49a9-8258-3a67ba54ec36" alt="Package type selection list"><figcaption><p>Build</p></figcaption></figure>

**Additional build options**

1. **Auto switch to bulk retrieve service if job hits metadata governor limit** – Automatically switches to batch retrieval if the job exceeds Salesforce limits. Specify **Batch size** (up to 10,000 items).
2. **Exclude installed (managed) components and changes** – Skip all managed-package components.
   * **Exclude all manually created components** – Also skip custom components inside managed packages.
3. **Incremental build** – Fetch only the metadata changed since the last successful deployment, greatly reducing build time.
4. **Include picklist modifications** – Always include picklist fields, even if Salesforce did not update their “last modified” date. (Source = Salesforce org only.)
5. **Generate code coverage report** – Include Apex test coverage details.
6. **Run static analysis report** – Run an SCA tool before committing.
   * **Apex PMD / Checkmarx** – Choose whether to scan all Apex classes or only those modified after a given date, and set a **Priority** threshold that causes the build to be marked unstable if not met.

     <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FE1e5V0Qinn85vchA5KNB%2Fimage.png?alt=media&#x26;token=cc0ec286-029d-4d36-9597-c35cb71e7e61" alt="Apex PMD and Checkmarx criteria configuration"><figcaption><p>Apex PMD / Checkmarx</p></figcaption></figure>
   * **CodeScan / SonarQube** – Choose to scan all supported metadata types or only newly added ones, and set a **Priority** threshold.

     <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FVVmSlxsgXlYQ0Xit27Ws%2Fimage.png?alt=media&#x26;token=bbf3025e-4aab-4d30-a8f4-02f9bf3c37eb" alt="CodeScan and SonarQube criteria configuration"><figcaption><p>CodeScan / SonarQube</p></figcaption></figure>

     * **Run on all supported metadata types** – Scan every retrieved component.
     * **Run on newly added supported metadata types** – Scan only components added in the current retrieval.

       <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2Fnt7cag33FHxmJC2ydEPD%2Fimage.png?alt=media&#x26;token=070a5084-b32c-4bb2-a712-b525de9bb5c5" alt="Run-scope options for supported metadata types"><figcaption><p>Components in Current Retrieval</p></figcaption></figure>
7. **Additional profile packaging options**
   * **Remove login IP ranges** – Omit IP range settings from profiles.
   * **Remove system and user permissions** – Omit profile permissions from deployment.
8. **Exclude metadata types** – Globally omit specific metadata types from all CI jobs.

{% hint style="info" %}
To set global exclusions in advance, open **My Account > My Salesforce Settings**, choose **Exclude metadata types**, and select the types to skip. These settings apply to all future CI jobs.
{% endhint %}

#### Backup to Version Control (auto-commit) <a href="#backup-to-version-control-auto-commit" id="backup-to-version-control-auto-commit"></a>

Enable **Auto commit** to push changes directly to your VCS:

1. Select the **Version control type** (Git, TFS, or SVN).
2. Choose the **Repository**, **Branch**, and **Credential**.
   * For an SFDX-structured repo, also select the **Package directory**. See [SFDX metadata format](https://knowledgebase.autorabit.com/product-guides/arm/arm-features/salesforce-dx/salesforce-dx-metadata-format).
3. Optional settings:

   * **Check out and commit with user’s credentials** – Commit all changes as the selected user.
   * **Check out with user credentials and commit with actual modified user credentials** – Preserve original authors.
   * **Configuration for recordTypes picklistValues** – Choose *Replace*, *Replace all*, or *Append*. ([Learn more](https://knowledgebase.autorabit.com/product-guides/arm/troubleshoot/how-tos/configure-record-types-picklist-values))

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FzDikBmeDbcQ6AY1VTFWF%2Fimage.png?alt=media&#x26;token=21cd587a-ca8a-4008-9169-22286a84ed74" alt="Auto-commit and credential options"><figcaption><p>Backup to Version Control (Auto Commit)</p></figcaption></figure>

#### Notifications <a href="#notifications" id="notifications"></a>

Send success or failure emails to selected recipients.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FWbI9bb3AuvQk00MYMg6W%2Fimage.png?alt=media&#x26;token=9db347a8-67a8-43f5-916f-fc49cfed1835" alt="Notification recipient list"><figcaption><p>Notifications</p></figcaption></figure>

#### Schedule <a href="#schedule" id="schedule"></a>

Run the job automatically:

* **Daily** – Run every day at the chosen time or interval.
* **Weekly** – Run on selected day(s) and time.
* **No schedule** – Save the job and run it manually when needed.

For credential-usage details across CI job types, see the [FAQ](https://knowledgebase.autorabit.com/product-guides/arm/troubleshoot/arm-faqs/ci-jobs).

### What’s next? <a href="#what-next" id="what-next"></a>

After saving the job, ARM redirects you to the [CI job results](https://knowledgebase.autorabit.com/product-guides/arm/arm-features/automation-and-ci/ci-job-history) page, where you can start the first build.
