Skip to content

HorizonsRC/github-backup

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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

About

A Python script to backup your GH organization

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%