CloudBase Environment Migration Guide
This document provides data and configuration migration solutions between CloudBase environments, helping you migrate resources from one environment to another.
Overview
CloudBase currently does not support one-click migration. You need to manually migrate data and configurations module by module. The migration process involves the following modules:
- Document Database: Data models, collection data
- MySQL Database: Data models, data tables
- Cloud Functions: Function code and configuration
- CloudRun: Service code and configuration
- Cloud Storage: Bucket files
- Static Website Hosting: Hosted files
- WeDa Applications: Low-code applications
Pre-migration Preparation
Before starting migration, please ensure:
- Confirm Target Environment: Create target CloudBase environment and obtain environment ID
- Permission Check: Ensure you have appropriate operation permissions in both source and target environments
- Install CLI Tool (Optional): Some migration operations require CloudBase CLI Tool
⚠️ Important Notes:
- Migration process will not automatically delete data in source environment, please proceed with confidence
- Some resources (such as database permissions, indexes) need to be manually reconfigured in target environment
Document Database Migration
Document database supports two data organization methods with different migration approaches:
Method 1: Data Model Migration
If you created data sources through "Data Model", simply export and import data model table structure and data for simple and efficient operation.
1. Export Data Model
- Visit CloudBase Platform/Document Database/Data Model
- Select the data model to migrate
- Export Data:
- Switch to "Manage Data" tab
- Click "Batch Export Data", select "All Data"
- If data exceeds 100,000 records, export in batches (single export limit is 100,000 records)
- Export Model Configuration:
- Switch to "Configure Model" tab
- Click "Export Model Configuration" button
2. Import Data Model
- Enter target environment's Data Model Management Page
- Import in reverse order of export:
- First import "Model Configuration"
- Then import "Data"
Method 2: Data Collection Migration
If you directly created collections for operations, you need to export collection data.
1. Export Collection Data
- Visit CloudBase Platform/Document Database/Collection Management
- Select the collection to export, click "Export" button
- Export Format: Select JSON format (required)
- If exported data file exceeds 50 MB, export in batches:
- Recommend exporting in batches by creation time or other fields
- Ensure single data file is less than 50 MB
2. Import Collection Data
- Enter target environment's collection management page
- Create collection with same name (if not exists)
- Select collection, click "Import" button, upload exported JSON file
⚠️ Notes:
- Database permission rules need to be manually reconfigured in target environment
- Database indexes need to be manually recreated in target environment
- Recommend migrating small amount of data for testing first, then bulk migrate after confirmation
MySQL Database Migration
MySQL database also supports two migration methods, choose corresponding migration method based on your data organization.
Method 1: Data Model Migration
If you created data sources through "Data Model", you can use data model's import/export functionality for migration.
Refer to Document Database/Data Model Migration for operation steps, the process is identical.
Method 2: Data Table Migration
If you directly created data tables for operations, you need to export and import through DMC database management platform.
1. Export Data Tables
- Visit CloudBase Platform/MySQL Database/Database Settings
- Create database account in "Account Management" module (skip if already created)
- Click "Database Management" button to enter DMC database management platform
- Perform data export operations in DMC platform
For detailed import/export operation methods, refer to MySQL Database/DMC Database Management/Import and Export
2. Import Data Tables
- Enter target environment's DMC database management platform
- Use import functionality to upload exported data files
⚠️ Notes:
- Database permission rules need to be manually reconfigured in target environment
- Database indexes need to be manually recreated in target environment
- Ensure target database has sufficient storage space before importing
Cloud Functions Migration
Cloud functions migration includes migration of function code and configuration, supporting both console operations and CLI commands.
Method 1: Console Operations
1. Export Cloud Function Code
- Visit CloudBase Platform/Cloud Functions
- Click the "Function Name" to migrate, enter function details page
- Switch to "Function Code" tab
- In "Grayscale Configuration" area below, select
$LATESTversion - Click "Download" button to download function code package (
.zipformat)
2. Import Cloud Function Code
- Enter target environment's Cloud Functions Management Page
- Click "Create Cloud Function"
- Select "Code Package Creation" method
- Upload exported code package (
.zipfile) - Configure function's runtime environment, memory, timeout and other parameters
- Click "Complete" to create function
💡 Tip: If function uses environment variables, they need to be reconfigured in target environment.
Method 2: CLI Command Operations
Using CLI tool can migrate cloud functions more efficiently in batches.
1. Download Cloud Function Code
Use CLI command to download function code:
# Download to default directory
tcb fn code download <functionName>
# Download to specified directory
tcb fn code download <functionName> <destPath>
Example:
# Download login function to current directory
tcb fn code download login
# Download to specified directory
tcb fn code download login ./functions/login
For detailed instructions, refer to CLI/Cloud Function Code Management
2. Deploy Cloud Function Code
Deploy cloud function in target environment:
# Deploy specified function
tcb fn deploy <functionName>
# Deploy all functions in functions directory
tcb fn deploy
Example:
# Switch to target environment
tcb env:switch <Target Environment ID>
# Deploy function
tcb fn deploy login
For detailed instructions, refer to CLI/Cloud Function Deployment
⚠️ Notes:
- Confirm whether function's runtime version is supported in target environment before migration
- Function triggers need to be reconfigured in target environment
- Function environment variables need to be reset in target environment
CloudRun Service Migration
CloudRun service migration requires exporting service code and redeploying in target environment.
Method 1: CLI Command Export
1. Export CloudRun Code
Use CLI command to download CloudRun service code:
tcb cloudrun download -s <Service Name> --targetPath <Target Path> --force
Parameter Description:
-s: Specify service name to download--targetPath: Specify local path to save code--force: Force overwrite existing files
Example:
# Download api-service to ./cloudrun/api-service directory
tcb cloudrun download -s api-service --targetPath ./cloudrun/api-service --force
For detailed instructions, refer to CLI/CloudRun Code Management
2. Deploy to Target Environment
Method 1: Console Upload Code Package
- Enter target environment's CloudRun Management Page
- Create new CloudRun service
- Select "Code Package Creation" method
- Upload exported code package (
.zipformat) - Configure service's CPU, memory, instance count and other parameters
- Complete creation and deployment
Method 2: CLI Command Deployment
# Switch to target environment
tcb env:switch <Target Environment ID>
# Execute deployment command in service code directory
cd ./cloudrun/api-service
tcb cloudrun deploy
For detailed instructions, refer to CLI/CloudRun Code Deployment
⚠️ Notes:
- CloudRun service environment variables need to be reconfigured in target environment
- Service access path and domain configuration need to be reset
- Ensure target environment has sufficient quota to support new service operation
Cloud Storage File Migration
Cloud storage uses Tencent Cloud Object Storage (COS) as underlying storage service, files can be migrated using COS data migration tools.
Migration Steps
1. View Source Environment Bucket Name
- Visit CloudBase Platform/Cloud Storage
- Record the "Bucket Name" displayed on the page

2. Execute Data Migration
Refer to COS to COS Data Migration documentation, use any of the following methods for migration:
- COS Migration Tool: Suitable for large batch file migration
- COS Console Batch Operations: Suitable for small file migration
- COSCMD Command Line Tool: Suitable for scripted migration
💡 Tips:
- Migration process will not affect data in source bucket
- Recommend testing with small amount of files before migration to confirm correct configuration
- Large file migration may take considerable time, please be patient
Static Website Hosting Migration
Static website hosting also uses Tencent Cloud Object Storage (COS) service, migration method is similar to cloud storage.
Migration Steps
1. View Source Environment Hosting Bucket Name
- Visit CloudBase Platform/Static Website Hosting/File Management
- Record the "Bucket Name" displayed on the page

2. Execute Data Migration
Refer to COS to COS Data Migration documentation for file migration.
3. Reconfigure Domain (If Any)
If you configured custom domain for static website hosting, you need to reconfigure domain in target environment:
- Enter target environment's static website hosting settings
- Add custom domain
- Configure DNS resolution to point domain to target environment
⚠️ Notes:
- Custom domain and SSL certificate need to be reconfigured after migration
- If CDN acceleration is used, it needs to be reconfigured in target environment
WeDa Application Migration
WeDa low-code applications support migration through template method.
Migration Steps
1. Export WeDa Application Template
- Visit CloudBase Platform/WeDa Low-Code/Custom Template Management
- Click "Create" button to create new template
- Enter "Template Details" page, add application resources to export
- Return to template list page, click corresponding template's "Export" button
- Select "Export Standardized Deployment Package"
- In "Template Details", switch to "Version" tab
- Click latest version's "Download" button to download deployment package
2. Import to Target Environment
- Enter target environment's WeDa Low-Code Console
- Create new application using downloaded deployment package
- Configure application's related parameters and resource bindings
- Publish application