Any backup snapshot created by the CloudSync feature can be restored in a couple of steps as described below:
- Confirm that CloudSync backup has been completed by checking your CloudSync settings and Rewind’s Audit log. Your backup snapshot on your Azure / Amazon S3 bucket is created immediately after Rewind’s automatic daily backup has been completed.
- Login to your AWS / Azure console and navigate to the Amazon S3 bucket configured for CloudSync (or your Blob storage container, in the case of Azure Sync).
- Within your Amazon S3 bucket / Azure Blob storage, you will find one or more directories corresponding to the Github ID of the account that was backed up by the CloudSync feature. Within each directory for GitHub IDs, you will find one or more folders corresponding to the Repository IDs belonging to the GitHub account which was backed up.
Identify the ID of the repository you’d like to restore and navigate into the repo backup directory (directory named after the repository you’d like to restore) in your Azure Blob storage / Amazon S3 bucket you’d like to restore.
Note: In the repo directory you will find several more directories, each representing a part of the repository that was backed up (issues, projects, review comments, etc), a file named REPOSITORY_FULLNAME - the contents of which hold the full name of the repository that was backed up, as well as a git repository directory called repository.git (If your repo has a wiki you will also find a directory called wiki.git)
- Download the “repository.git” directory from the repo backup directory and unzip the downloaded file if it’s a zipped file. This unzipped directory includes the whole repository that was backed up including all objects, commits, tags, and history. Place this unzipped directory to your desired location and copy the path to that location.
- Clone the directory locally using “git clone <path to repository.git>” to create a working tree that can be viewed and edited. Alternatively, you can add a new GitHub repository remote URL and push to manually restore to GitHub using the following:
cd repository.git git remote add origin git@github.com:your-org/your-new-repo.git git push origin --tags refs/heads/*
NOTE: In the above code, "your-org" is the name of your GitHub organization, and "your-new-repo" is the name of the newly created repository you will restore to.
(Please note that the backup snapshots created by CloudSync on your Azure Blob storage / Amazon S3 bucket are additional backup snapshots and they cannot be accessed or restored from the Rewind self-serve portal. )