Skip to main content
The migration plugin is an experimental feature. Updates to the Cognite Toolkit are likely to introduce changes to the described commands and processes.
This guide walks data engineers through deploying the CogniteMigration data model, which stores the lineage information the migration plugin needs for later migration phases.

Required capabilities

The following capabilities are required to run cdf migrate prepare:

Deploying the CogniteMigration data model

The migration plugin requires that you store the lineage of the migration process in Cognite Data Fusion (CDF). A user-controlled data model called CogniteMigration stores this lineage.
1

Run `cdf migrate prepare`

Deploy the CogniteMigration data model to your CDF project if it does not already exist.
2

Verify the data model

Confirm that the CogniteMigration data model exists in your CDF project. You should see the views described in CogniteMigration data model structure.
CogniteMigration data model: Space Source, Created Source System, Resource View Mapping, and Instance Source.

CogniteMigration data model structure

The CogniteMigration data model consists of the following main concepts:

Space Source

This concept tracks which data set each instance space was created from. Instance spaces are the primary access control mechanism in data modeling. They are not equivalent to CDF data sets, as data sets are a property on the data, while spaces are part of the identifier of the data. Later migration phases use this information to look up which instance space to use when creating data model instances. For more information about the data set migration, see Data sets.
All nodes with properties in the SpaceSource view are expected to be located in the cognite_migration space.

Created Source System

In the asset-centric schema, only assets, events, and files have a source. The source is a simple string property, with no further structure. In the data modeling world, CogniteSourceSystem is a first-class concept that can store more information about the source system. Assets, time series, activities, and files all have a pointer to a CogniteSourceSystem. To migrate the source property, the migration plugin tracks which source strings map to which CogniteSourceSystem identifier. For more information about source system migration, see Source system.
All nodes with properties in the CreatedSourceSystem view are expected to be located in the cognite_migration space.

Resource View Mapping

To migrate from asset-centric to data modeling-based CDF projects, you need to have mappings from the asset-centric resources to the data model resources. These mappings are stored in this view. You govern the resource-to-view mappings, making them reusable across CDF projects. You can also define multiple mappings for each resource type. For example, you can have one mapping from asset to wind turbine, and another from asset to wind farm. When you run cdf migrate prepare, the Cognite Toolkit deploys several default resource view mappings to help you get started. These default mappings are for each resource type and map to the appropriate view in the Cognite Core data model.
All nodes with properties in the ResourceViewMapping view are expected to be located in the cognite_migration space.

Instance Source

When you migrate assets, events, time series, and file metadata, the Cognite Toolkit stores the lineage: which source resource maps to which data modeling instance. Application-level and access management migration need this mapping for dependent resources. For example, Charts and Canvas contain references to assets, time series, and files. The Cognite Toolkit uses the lineage to update those references to the new instances. You can also set the preferred consumer view for each instance. The Charts and Canvas migration uses this setting to select which view to use when looking at the data modeling instance.
After you migrate assets, events, time series, and file metadata, the InstanceSource view contains one entry for each migrated resource. This does not impact the instance budget of your CDF project. Each migrated resource is already one instance, and adding properties in the InstanceSource view does not increase the instance count.Do not delete the instances in this view. They are the migrated assets, events, time series, and files. After you complete the migration, delete the CogniteMigration data model instead. Deleting the data model removes only the lineage data and leaves the migrated instances in place.

Manual population of the CogniteMigration data model

If you are not migrating Charts, Canvas, annotations, Cognite InField, or 3D models using the migration plugin, you can skip this section.
The Cognite Toolkit populates the CogniteMigration data model automatically when you migrate data sets, source systems, assets, events, time series, and file metadata. If you skip those commands — for example, by updating your data pipelines to write to data modeling instances instead of asset-centric resources — you must add the lineage yourself. You need that lineage to migrate Charts, Canvas, annotations, InField, and 3D models.

Example of manually creating lineage using the Cognite SDK

This example uses the Cognite Python SDK (cognite-sdk) to create lineage from the asset my_source_asset to the instance my_migrated_asset in the destination_space space. It also sets the preferred consumer view to MyCogniteAssetExtension in the my_schema_space space. Charts and Canvas use that view when they display the asset. Before you run this snippet, deploy the CogniteMigration data model. The asset my_source_asset and the instance my_migrated_asset must already exist in your CDF project.

Example of manually creating lineage using the data plugin

You can use the Cognite Toolkit data plugin to download the source data, create the lineage data offline, and then upload it using the data plugin. This takes advantage of the data plugin’s optimized upload and download functionality. To enable the data plugin, enable it in your cdf.toml file. You also have to enable the alpha flags that extend the download and upload functionality of the data plugin.
cdf.toml
For example, if you want to download all assets in the my_source_assets data set, you can run the following command:
This downloads all the assets in the my_source_assets data set to the data/ directory in CSV format. You can then create the lineage data offline, using for example Pandas:
create_lineage.py
Next, create a manifest file specifying the InstanceSource view. Use the same base name for this file as the file containing the lineage data itself (here, lineage) and add the .Manifest.yaml suffix to the file name:
data/lineage/lineage.Manifest.yaml
Now upload the lineage data to CDF using the data plugin:

Further reading

Last modified on August 21, 2026