Skip to content
A Python script to backup your GH organization
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE
README.md
github-backup.py
nagios-check.py
requirements.txt

README.md

github-backup

A simple script to backup the most important informations (repositories, wikis, pull requests+comments, issues+comments, teams and members) of your GitHub organization in a readable and usable format.

Structure of backed up files

.
├── members
│   ├── members-2014-04-29.tar.bz2
│   │   ├── member1.json
│   │   └── member2.json
│   └── members-2014-04-30.tar.bz2
│       ├── member1.json
│       ├── member2.json
│       └── member3.json
├── private-repos
│   └── ...
├── public-repos
│   └── repo1-id-2014-04-30.tar.bz2
│       ├── repo1
│       ├── repo1-collaborators.json
│       ├── repo1-issues-comments.json
│       ├── repo1-issues.json
│       ├── repo1.json
│       ├── repo1-pulls-comments.json
│       ├── repo1-pulls.json
│       └── repo1.wiki
└── teams
    ├── teams-2014-04-29.tar.bz2
    │   ├── team1.json
    │   └── team2.json
    └── teams-2014-04-30.tar.bz2
        ├── team1.json
        ├── team2.json
        └── team3.json

Directories public-repos/repo1-id-2014-04-30.tar.bz2/repo1 and public-repos/repo1-id-2014-04-30.tar.bz2/repo1.wiki are simply the source of Git repositories (see clone --mirror for more information)

Usage

Create a simple configuration file (e.g. github-backup.conf) with the following infos:

[github-backup]

token: XXX
organization: camptocamp
destdir: /your/backup/folder
retention: X # how many archives to keep, an integer

Where token is a GitHub personal access token with the "repo" and "read:org" scopes. It is also possible to provide username and password instead of token.

And run the script like this:

$ ./github-backup.py -c github-backup.conf
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.