How to Batch Migrate Coding, GitHub, GitLab, and Gitee Repositories to CNB with Docker
This guide explains how to compare major code‑hosting platforms, set up required tokens, and use a Docker‑based CNB import tool to batch‑migrate repositories from Coding, GitHub, GitLab, and Gitee into Tencent's CNB environment, including command syntax and post‑migration access details.
Migration Alternatives Comparison
Comparison of four code‑hosting platforms—GitHub, GitLab, Gitee, and Coding—across dimensions such as access speed, compliance, open‑source ecosystem, feature completeness, data privacy, pricing model, and team collaboration. GitHub offers a global community but may be slower in China; GitLab can be self‑hosted; Gitee provides fast domestic access and complies with Chinese regulations; Coding (CNB) combines strong CI/CD features with a Chinese‑hosted ecosystem.
CNB Overview
CNB is a Docker‑based productivity platform developed by Tencent. It ensures environment consistency, branch‑per‑environment, rapid cloning, and build acceleration, and supports Git‑based code hosting, continuous integration, remote development, and open‑source collaboration.
CNB Repository Batch Migration Tool
The tool migrates repositories from Coding, GitHub, GitLab, Gitee, Alibaba Cloud DevOps, Tencent Gongfeng, and generic third‑party platforms to CNB. Repository URL: https://cnb.cool/cnb/plugins/cnbcool/code-import
Docker Migration Command
docker run --rm \
-e PLUGIN_SOURCE_TOKEN="xxxxxxxxx" \
-e PLUGIN_CNB_ROOT_ORGANIZATION="tinywan" \
-e PLUGIN_CNB_TOKEN="xxxxxxxxxx" \
cnbcool/code-importParameter Introduction
PLUGIN_SOURCE_TOKEN: API token for the source code‑hosting platform. PLUGIN_CNB_ROOT_ORGANIZATION: Name of the root organization in CNB (must be created beforehand, e.g., tinywan). PLUGIN_CNB_TOKEN: CNB personal access token, created at https://cnb.cool/profile/token.
Creating a Coding Platform Token
Generate a read‑write token at https://wiot.coding.net/user/account/setting/tokens.
Creating a CNB Authorization Token
Obtain the CNB access token at https://cnb.cool/profile/token.
Start Migration
docker run --rm \
-e PLUGIN_SOURCE_TOKEN="29d515db023cbd08cxxxxxxxxxx" \
-e PLUGIN_CNB_ROOT_ORGANIZATION="tinywan" \
-e PLUGIN_CNB_TOKEN="49T4f13f1xxxxxxxxxxxxx" \
cnbcool/code-importAfter migration, the CNB instance is accessible at https://cnb.cool/tinywan.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
