---
url: /en/guide/migration-tools.md
description: >
  Introduces tools for migrating code repositories to CNB, including Code Import
  for batch migration, Git Sync for cross-platform synchronization, and
  artifact/collaboration data migration.
---
## CNB Code Import

Batch migration of code repositories to CNB, supporting import from GitHub, GitLab, Gitee, and other platforms.

Tool address:
<https://cnb.cool/cnb/plugins/cnbcool/code-import>

## Git Sync

Cross-platform Git code sync plugin for syncing code between different Git platforms.

Tool address:
<https://cnb.cool/cnb/plugins/tencentcom/git-sync>

## Artifact Migrate

Migrate Maven, npm, Composer, and NuGet artifacts from other registries to CNB.

Tool address:
<https://cnb.cool/cnb/plugins/cnbcool/artifact-migrate>

## Collaboration Migrate

Migrate `CODING` project collaboration data to TAPD or CNB.

Tool address:
<https://cnb.cool/CODING/tool/migrate-collaboration>

## Migration Example

The following example fully migrates a public GitHub repository to CNB,
preserving all history:

```bash
# 1. Clone the bare repository
git clone --bare https://github.com/example/example-repo.git

# 2. Push to CNB (--mirror syncs all branches and tags)
cd example-repo.git
git push --mirror https://cnbprod.alpha.qq.com/my-group/example-repo.git

# 3. Clean up temporary files
cd .. && rm -rf example-repo.git
```

`git push --mirror` pushes all branches and tags of the remote, which is suitable for a full migration.
If you only need to migrate specific branches, clone normally and push the desired branches one by one.
