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.
.
βββ 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)
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