Application which orchestrates whole process of Keboola Connection project migration from one stack to another.
Prerequisites:
- Source project which will be migrated
- Destination project - empty project where the source project will be cloned
Application is executed in destination project and requires Storage API token and Keboola Connection URL of source project. Admin token of source project is required for GoodData writers migration. Source project is left without any changes.
Migration steps performed by the application:
- Create snapshot of source project https://github.com/keboola/app-project-backup
- Restore project from snapshot https://github.com/keboola/app-project-restore
- Migrate GoodData writers https://github.com/keboola/app-gooddata-writer-migrate
- Migrate Snowflake writers https://github.com/keboola/app-snowflake-writer-migrate
- Migrate Orchestrators https://github.com/keboola/app-orchestrator-migrate
- Migrate Data Gateway configurations (creates new workspaces with keypair authentication)
It is recommended to run migration validation application in the source project before migration.
Run the migration in destination project wil the following command. This is example of project migration from US to EU, please replace these parameters:
DEST_PROJECT_SAPI_TOKEN- Storage API token associated to admin of destination EU project (master)SOURCE_PROJECT_SAPI_TOKEN- Storage API token associated to admin of source US project (non-master, all permissions are required)SOURCE_MANAGE_API_TOKEN- Manage API token with super admin rights. Must be from source stack. Required if parametermigrateSecretsistrue.
curl -X POST \
--location 'https://queue.eu-central-1.keboola.com/jobs' \
--header 'X-StorageApi-Token: DEST_PROJECT_SAPI_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"component": "keboola.app-project-migrate",
"mode": "run",
"configData": {
"parameters": {
"sourceKbcUrl": "https://connection.keboola.com",
"#sourceKbcToken": "SOURCE_PROJECT_SAPI_TOKEN",
"directDataMigration": true,
"dryRun": false,
"dataMode": "sapi",
"migrateSecrets": false,
"migratePermanentFiles": false,
"migrateTriggers": true,
"migrateNotifications": true,
"migrateStructureOnly": true,
"migrateBuckets": true,
"migrateTables": true,
"migrateProjectMetadata": true,
"migrateDataGateway": true,
"skipRegionValidation": true,
"checkEmptyProject": true,
"isSourceByodb": false,
"includeWorkspaceSchemas": [],
"preserveTimestamp": false,
"#sourceManageToken": "SOURCE_MANAGE_API_TOKEN"
}
}
}'The request contains the following parameters:
sourceKbcUrl: URL of the source Keboola Connection project#sourceKbcToken: Token for accessing the source project#sourceManageToken: Manage API token with super admin rights from the source stackdataMode: "sapi" - Data transfer mode via Storage APIdirectDataMigration: Enables direct data migration between projectsdryRun: When set to true, performs a test run without actual migrationmigrateSecrets: Enables migration of secrets and passwordsmigratePermanentFiles: Controls migration of permanent filesmigrateTriggers: Enables migration of triggersmigrateNotifications: Enables migration of notificationsmigrateStructureOnly: When true, migrates only the project structuremigrateBuckets: Enables migration of bucketsmigrateTables: Enables migration of tablesmigrateProjectMetadata: Enables migration of project metadatacheckEmptyProject: Check if the destination project is empty before migrationskipRegionValidation: Skips validation of regions during migrationmigrateDataGateway: Enables migration of Data Gateway configurations (default: true). Creates new READER workspaces with keypair authentication. Note: Data from original workspaces is NOT migrated - users must load data manually.isSourceByodb: Whether the source project is a BYODB project (default: false)sourceByodb: Source BYODB identifier (required whenisSourceByodbis true)includeWorkspaceSchemas: Array of workspace schema names to include in migration (default: [])preserveTimestamp: Preserve original table timestamps during data migration (default: false)forcePrimaryKeyNotNull: When true, forces primary key columns to be NOT NULL during migration (default: false). Propagated to bothapp-project-restoreandapp-project-migrate-large-tables.tableParallelism: Number of tables to migrate in parallel during restore (default:5). Propagated toapp-project-restore.gcsLargeTable: Configuration for GCS large table migration (propagated toapp-project-migrate-large-tables):parallelChunks: Number of parallel chunks to use during GCS table migration (default:3, max:20)chunkSize: Size of each chunk in MB during GCS table migration (default:150)
componentsDevTag: Object with dev branch tags for migration components:backup: Dev tag for the backup componentrestore: Dev tag for the restore componenttablesData: Dev tag for the tables data migration component
db: Database connection object for direct database migration (required whendataModeisdatabase):host: Snowflake host (required)username: Database username (required)#password: Database password (one of#passwordor#privateKeyis required)#privateKey: Private key for authentication (one of#passwordor#privateKeyis required)warehouse: Snowflake warehouse name (required)warehouse_size: Warehouse size -SMALL,MEDIUM, orLARGE(default:SMALL)
If you want to save some time and check that everything is set correctly, you can use the dry-run
mode. Just set configData.parameters.dryRun on true in your request payload.
What is not executed during dry-run mode?
- add project metadata into destination project
- add restored configurations, its rows, metadata, state and row order into destination project
- create buckets and its metadata in destination project
- create tables, table aliases and metadata in destination project
- add migrated configurations, its rows, metadata, state and row order into destination project
- create workspace for destination project (Keboola-provisioned writers)
- add migrated configurations and its rows
- default (API) mode:
- file upload into destination project
- write data into destination tables
- database mode:
- create new READER workspace with keypair authentication
- update configuration with new workspace credentials
- Note: Workspace data is NOT migrated
Clone this repository and init the workspace with following command:
git clone https://github.com/keboola/my-component
cd my-component
docker-compose build
docker-compose run --rm dev composer install --no-scriptsRun the test suite using this command:
docker-compose run --rm dev composer testsFor information about deployment and integration with KBC, please refer to the deployment section of developers documentation
MIT licensed, see LICENSE file.