clone_catalog_async
Start a background catalog clone by tracing data from a root RID, and get a task ID to track progress for large or cross-server operations.
Instructions
Create an ML workspace by cloning data reachable from a root RID.
Starts the workspace creation in the background and immediately returns a task_id that you can use to check progress.
The operation uses export annotations (if available) to determine which tables and paths to follow from the root RID, then fills in any uncovered tables (vocabularies, associations). Uses async data copying for performance.
Use this for large catalogs or cross-server clones that may take several
minutes to complete. Check progress with get_task_status(task_id).
Args: source_hostname: Source server hostname (e.g., "www.facebase.org"). source_catalog_id: ID of the catalog to clone. root_rid: The starting RID from which to trace reachability (e.g., "3-HXMC"). dest_hostname: Destination hostname. If None, uses source hostname. alias: Optional alias name for the new catalog. add_ml_schema: If True, add the DerivaML schema to the clone. asset_mode: How to handle assets: "none", "refs" (default), or "full". copy_annotations: If True (default), copy all annotations. copy_policy: If True (default), copy ACL policies. exclude_schemas: Schemas to exclude from cloning. exclude_objects: Tables ("schema:table") to exclude. reinitialize_dataset_versions: If True, reinitialize dataset versions. orphan_strategy: How to handle orphans: "fail", "delete", "nullify". prune_hidden_fkeys: Skip FKs with hidden reference data. truncate_oversized: Truncate values exceeding index limits. include_tables: Additional tables to include. include_associations: Include association tables. include_vocabularies: Include vocabulary tables. table_concurrency: Max concurrent table copies during fill phase. Lower values reduce server load. Default: 2.
Returns: JSON with task_id and status. Use get_task_status(task_id) to check progress.
Example: clone_catalog_async("www.facebase.org", "1", root_rid="3-HXMC", dest_hostname="localhost", alias="facebase-clone", orphan_strategy="delete") -> {"task_id": "abc123", "status": "started", ...}
# Check progress
get_task_status("abc123")
-> {"status": "running", "progress": {"percent_complete": 45.0, ...}}
# When done
get_task_status("abc123")
-> {"status": "completed", "result": {...}}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| alias | No | ||
| root_rid | Yes | ||
| asset_mode | No | refs | |
| copy_policy | No | ||
| add_ml_schema | No | ||
| dest_hostname | No | ||
| include_tables | No | ||
| exclude_objects | No | ||
| exclude_schemas | No | ||
| orphan_strategy | No | fail | |
| source_hostname | Yes | ||
| copy_annotations | No | ||
| source_catalog_id | Yes | ||
| table_concurrency | No | ||
| prune_hidden_fkeys | No | ||
| truncate_oversized | No | ||
| include_associations | No | ||
| include_vocabularies | No | ||
| reinitialize_dataset_versions | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |