This repo was built to migrate large repositories (i.e git clone <source-repo-ssh> --mirror
> 2GB) and git lfs objects. It is highly recommended to use Michael Welch's git migration (https://github.com/NicholasBoll/github-migration) if when you clone your repository using git clone <source-repo-ssh> --mirror
< 2GB. Credit goes to Michael Welch for creating the base code. The migration.sh
file has been added to further streamline the amount of commands needed to run in the terminal, whereas features have been added to enhance the base code—such as the support for git lfs objects as well as repos that are too big for git push <dest-repo> --mirror
—the creation of issues, branches, and comments has been optimized.
It is important for users to ensure that they have non-user admin tokens for both their source and target GitHub before beginning the migration process. Furthermore, this tool does not create a new repository in the destination GitHub; users will have to create an empty repository in their target Github to migrate their source repository into. If you have dependabot security updates enabled, disable it before pushing your new repo. If it picks up a new vulnerability, it can auto-create a PR and your issue numbers will no longer match. There is no API access to migrate images to the target GitHub CDN Githubusercontent. The tool checks whether images are in issues' descriptions or comments, uploads them to the provided S3 bucket, and updates the image link. If you want to use this functionality, create an S3 bucket and configure it in the config.js
and s3Config.js
files that are created during initialization. (See below steps)
- Ensure you have non-user admin tokens for both the source and the target Github.
- Create an empty repository in the destination Github.
- If you have dependabot security updates enabled, disable it before pushing your new repo. If it picks up a new vulnerability, it can auto-create a PR and your issue numbers will no longer match.
- There is no API access to migrate images to the target GitHub CDN
Githubusercontent. The tool checks whether images are in issues' descriptions
or comments, uploads them to the provided S3 bucket, and updates the image
link. If you want to use this functionality, create an S3 bucket and
configure it in the
config.js
ands3Config.js
files that are created during initialization. (See below steps) - Edit bash_config.sh variables.
- Edit line 11 of
createComments.js
so thatconst dummyCommit =
any valid commit hash:git clone <source-repo-ssh> --single-branch
.cd <source-repo>
.- Copy the result of
git rev-list --max-parents=0 HEAD
. cd ..
.rm -rf <source-repo>
.- Edit line 11 of
createComments.js
so thatconst dummyCommit =
the result ofgit rev-list --max-parents=0 HEAD
.
- Clone this repository.
- Navigate to the
git-lfs-mover
directory. - run
npm run install
. - Run the initialization script by running
node init.js
. - Edit
config.js
ands3Config.js
. Optional: Test your source configuration by runningnode test.js source
. Test your destination configuration by runningnode test.js target
Test your S3 configuration by runningnode s3Test.js
- Edit
migrate.sh
andcreateComments.js
as described above. - Make the
migrate.sh
executable by runningchmod -x migrate.sh
. - Run
./migrate.sh -h
to view the flags. - Run
./migrate.sh
with the specified flags.