# Single repository recovery

## Recovery process

{% stepper %}
{% step %}
Get into the restore view using the following method:

1. Open the **GitHub** tab (**DevOps** > **GitHub**), then click the **Restore** button next to the organization whose backup you want to restore.

{% hint style="success" %}
You can also use the **Explore** button to restore your data.
{% endhint %}

2. Search for the repository you want to restore, and click the **Restore** button in the action menu of that repository.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-2ec8c7940ac25c6a18f30520dfbcca6689063c6c%2Fimage.png?alt=media" alt="" width="563"><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Next, select the backup plan from which you want to restore data. Click **View available plans** and choose one of the plans from the list.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-7a3110079f8f71d3cb8dca01142cb13526d29214%2Fimage%20(1066).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Choose the backup version from all the backups that have already been performed — select the desired date and click the **Restore** button.

{% hint style="success" %}
**GitProtect** allows you to select specific metadata to restore — each element can be included or excluded by toggling the switch next to it. Additionally, there is a **Wiki** recovery option below these settings. If your repository already exists in **GitHub**, you can choose to restore only the **Wiki**.
{% endhint %}

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-701e4ead1ddb99c9b467016c5c312779ecfc6b03%2Fimage%20(1067).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Select the destination for the restore process. You can choose one of the assigned organizations from any **Git** service or any device. After selecting the repository and the metadata you want to include, click the **Restore selected** or **Restore all** button to proceed.
{% endstep %}

{% step %}
In the next aside, click **Edit** next to **Data to restore** if you need to adjust it.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-0099887c6788db92864c98dd6268ded4eb0ed380%2Fimage%20(1069).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Next, select the destination where you want to restore the data.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-d41037c79f0b7f6fc0ed2e5299cefdc803ca553e%2Fimage%20(1070).png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %} <mark style="color:red;">**Support for backing up projects (classic) has been removed.**</mark> It is now available only for restoring previously backed-up **projects (classic)** — when restored, **projects (classic)** are automatically converted into **projects v2**.
{% endhint %}

#### **A. Restore to a Git organization**

{% hint style="info" %}
During restoration to **GitHub**, the **Use existing projects instead of creating new ones option** becomes available. When restoring **projects v2**, this option restores the data into the existing projects rather than creating new ones.
{% endhint %}

In **Restore settings** you can set a custom name for the repository that will be created during the restore process and limit the internet bandwidth.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-5de6951cce97fda9350c5905bad2858097d76d4c%2Fimage%20(1071).png?alt=media" alt=""><figcaption></figcaption></figure>

You can enter a new repository name in one of the following formats:

1. If you enter **organization/name** (e.g., **xsupport/test**), the repository will be restored with the chosen name in the specified organization. If the entered organization does not exist, the repository will be restored to the source organization.
2. If you enter **only the repository name** (e.g., **test**) and the source organization is registered in **GitProtect**, the repository will be restored there. If the organization is not registered, the repository will be restored to your account.

{% hint style="danger" %}
Restoring never overwrites existing repositories in the organization — if you do not choose a repository name, or if you enter the name of a repository that already exists in your organization, **the restore will fail**. To complete the restoration successfully, you must choose a unique repository name or select the **Add suffix to repo name** option so the restored repository keeps its original name with an automatically generated suffix.
{% endhint %}

#### **B. Restore to a device**

{% hint style="warning" %}
To restore a repository to a local device, you must have a **Git** client installed on that device.
{% endhint %}

{% hint style="danger" %}
You can restore **only the repository** (without metadata) when restoring data to local resources.
{% endhint %}

1. Select the destination device.
2. Make sure the device where you want to restore data has the **GitProtect agent** installed and the **Git** client added to the **PATH** environment variable. The **PATH** variable is usually configured automatically after **Git** installation (a system restart may be required). If it isn’t, set it manually to the path of the **git.exe** file: `C:\Program Files\Git\bin\git.exe`

{% hint style="info" %}
To configure the **PATH** variable, open the environment variables, select the **PATH** variable, and click the **Edit** button. Copy the path to the **git.exe** file and add it to the **PATH** variable.
{% endhint %}

3. Select the directory where you want the data to be restored.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-92f41a578b7486c5d946ffba72221f1e9bbb2d20%2Fimage%20(1073).png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
If a repository already exists in the selected folder, you can choose to overwrite the existing data.
{% endhint %}

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2Fgit-blob-ee3f6eb5fd71f8f58bac107bba49ec1fbf94fa7e%2Fimage%20(1074).png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Choose the device that will be responsible for performing the restoration.

<figure><img src="https://696332517-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FtsE6XtJyUIEKVdSxPlS3%2Fuploads%2FiDucvUvXsoabwyfuKh1r%2Fimage.png?alt=media&#x26;token=fef4dc02-2be2-4276-9e43-138518bdfe19" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
After defining all parameters, click the **Restore** button to begin the restore process. When the process is complete, a new repository will be created in your organization account.

{% hint style="warning" %}
**Closed** or **merged** pull requests are recovered as **closed issues**.
{% endhint %}
{% endstep %}
{% endstepper %}

***

## Restoration time

Extensive testing and analysis have shown that restoring repositories with many issues and pull requests significantly prolongs the restoration process. This delay is caused by limitations within **GitHub**’s infrastructure and the **API** used for repository restoration.

To speed up the repository access, **it is recommended** to exclude issues and pull requests during the initial restore. Once the repository is restored, you can perform a subsequent restore—including issues and pull requests—under a different repository name. This approach ensures quick access while still allowing full restoration of repository content.

***

## Useful links and items

{% content-ref url="../../../../deployment-and-configuration/gitprotect-worker" %}
[gitprotect-worker](https://helpcenter.gitprotect.io/deployment-and-configuration/gitprotect-worker)
{% endcontent-ref %}

{% content-ref url="../../general/cross-recovery-for-devops-organizations" %}
[cross-recovery-for-devops-organizations](https://helpcenter.gitprotect.io/backup-and-recovery/devops/general/cross-recovery-for-devops-organizations)
{% endcontent-ref %}

{% content-ref url="../../general/lfs-recovery-for-devops-organizations" %}
[lfs-recovery-for-devops-organizations](https://helpcenter.gitprotect.io/backup-and-recovery/devops/general/lfs-recovery-for-devops-organizations)
{% endcontent-ref %}

{% content-ref url="../../general/wiki-recovery-for-devops-organizations" %}
[wiki-recovery-for-devops-organizations](https://helpcenter.gitprotect.io/backup-and-recovery/devops/general/wiki-recovery-for-devops-organizations)
{% endcontent-ref %}

{% content-ref url="../../../../risk-and-compliance-management/throttling-prevention" %}
[throttling-prevention](https://helpcenter.gitprotect.io/risk-and-compliance-management/throttling-prevention)
{% endcontent-ref %}
