GitHub

How to create and retrieve your Github tokens

Read our detailed guide on how to set up your GitHub Backup.

 

Creating your GitHub tokens

To back up your data with GitHub, you need to create a personal access token to connect GitHub to SimpleBackups.

These tokens allow access to GitHub resources when using the GitHub API or command line.

Currently, GitHub supports two types of personal access tokens:

  • fine-grained personal access tokens
  • classic personal access tokens.

SimpleBackups currently supports the classic token, which can be generated by going to:

Notion image

Once you have created a classic personal access token, copy the token to use later to set up the connection with SimpleBackups.

Notion image
 

Configuring your SimpleBackups Github backup

  • Paste the token you generated earlier
  • Enter your GitHub username
  • Select options based on your unique circumstances:
    • Whether the backup is for a private or organizational account. When you select the private account option, the backup will also include private repositories.
    • ℹ️
      It is important to note that when backing up an organization account, you need to enter the name of the organization in the User field of GitHub. Additionally, ensure that the organization is configured to allow your personal access tokens for backup purposes.
  • Select which repositories you’d like to back up. You can choose between Starred Repos, Watched Repos, and Forked Repos. You can also choose to back up a specific repo.
  • Choose other options you might want to back up. Based on your needs, you can run full backups, or back up only issues, pulls, wikis, gists, releases, or assets.
Notion image
 

Restore your GitHub Backup to a New Repository

To restore a GitHub repository from a backup, as a new repository, you can follow these steps:

  1. First, create a new repository on GitHub with the same name as the repository you want to restore.
  1. Clone the newly created repository to your local machine using the git clone command. For example: git clone https://github.com/your-username/new-repo-name.git
  1. Navigate to the local repository directory on your machine using the cd command. For example: cd new-repo-name
  1. Copy the contents of your backup (download from SimpleBackups, then go to repositories/repo-name) into this directory. You can use the cp command to do this. For example: cp -r /path/to/backup/* /path/to/simplebackups/repository/repo-name
  1. Stage the changes using the git add command. For example: git add .
  1. Commit the changes using the git commit command. For example: git commit -m "Restoring backup"
  1. Push the changes to GitHub using the git push command. For example: git push origin main (assuming main is the default branch of your repository)

That's it! Your repository should now be restored from your backup.

 
 

 

FAQ

 
Message: “Resource protected by SAML enforcement”

This error means the organization enforces SAML / SSO, and SimpleBackups has not been explicitly authorized to access the organization’s resources.

What’s happening

  • The organization has SAML enforcement enabled
  • Even if the user has access to the repo/resource
  • OAuth apps (like SimpleBackups) must be approved by an org admin

Until that approval is done, the API will block access and return this message.


How to fix it (organization admin)

An organization owner must:

  1. Go to GitHub → Organization → Settings
  1. Open Security → Authentication → SAML SSO
  1. Find Authorized OAuth Apps
  1. Locate SimpleBackups
  1. Click Grant access

Once approved, SimpleBackups can access the organization’s repositories for SSO-authenticated users.

Did this answer your question?
😞
😐
🤩

Last updated on August 6, 2021