Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Tutorials
    • All tutorials
    • Unassisted deployment of the Apache Kafka® web interface
    • Upgrading a Managed Service for Apache Kafka® cluster to migrate from ZooKeeper to KRaft
    • Migrating a database from a third-party Apache Kafka® cluster to Managed Service for Apache Kafka®
    • Moving data between Managed Service for Apache Kafka® clusters using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Debezium
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Debezium
    • Delivering data from Managed Service for YDB to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for ClickHouse® using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Yandex MPP Analytics for PostgreSQL using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Yandex StoreDoc using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for MySQL® using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for OpenSearch using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for PostgreSQL using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Managed Service for YDB using Data Transfer
    • Delivering data from Managed Service for Apache Kafka® to Data Streams using Data Transfer
    • Delivering data from Data Streams to Managed Service for YDB using Data Transfer
    • Delivering data from Data Streams to Managed Service for Apache Kafka® using Data Transfer
    • YDB change data capture and delivery to YDS
    • Configuring Kafka Connect to work with a Managed Service for Apache Kafka® cluster
    • Synchronizing Apache Kafka® topics in Object Storage with no web access
    • Monitoring message loss in an Apache Kafka® topic
    • Automating Query tasks with Managed Service for Apache Airflow™
    • Sending requests to the Yandex Cloud API via the Yandex Cloud Python SDK
    • Configuring an SMTP server to send e-mail notifications
    • Adding data to a ClickHouse® DB
    • Migrating data to Managed Service for ClickHouse® using ClickHouse®
    • Migrating data to Managed Service for ClickHouse® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for ClickHouse® using Data Transfer
    • Asynchronously replicating data from PostgreSQL to ClickHouse®
    • Exchanging data between Managed Service for ClickHouse® and Yandex Data Processing
    • Configuring Managed Service for ClickHouse® for Graphite
    • Fetching data from Managed Service for Apache Kafka® to Managed Service for ClickHouse®
    • Fetching data from Managed Service for Apache Kafka® to ksqlDB
    • Fetching data from RabbitMQ to Managed Service for ClickHouse®
    • Saving a data stream from Data Streams to Managed Service for ClickHouse®
    • Asynchronous replication of data from Yandex Metrica to ClickHouse® using Data Transfer
    • Using hybrid storage in Managed Service for ClickHouse®
    • Sharding Managed Service for ClickHouse® tables
    • Loading data from Yandex Direct to a Managed Service for ClickHouse® data mart using Cloud Functions, Object Storage, and Data Transfer
    • Loading data from Object Storage to Managed Service for ClickHouse® using Data Transfer
    • Migrating data from Managed Service for OpenSearch to Managed Service for ClickHouse® with a storage change using Data Transfer
    • Loading data from Managed Service for YDB to Managed Service for ClickHouse® using Data Transfer
    • Yandex Managed Service for ClickHouse® integration with Microsoft SQL Server via ClickHouse® JDBC Bridge
    • Migrating databases from Google BigQuery to Managed Service for ClickHouse®
    • Yandex Managed Service for ClickHouse® integration with Oracle via ClickHouse® JDBC Bridge
    • Configuring Cloud DNS to access a Managed Service for ClickHouse® cluster from other cloud networks
    • Migrating a Yandex Data Processing HDFS cluster to a different availability zone
    • Importing data from Managed Service for MySQL® to Yandex Data Processing using Sqoop
    • Importing data from Managed Service for PostgreSQL to Yandex Data Processing using Sqoop
    • Mounting Object Storage buckets to the file system of Yandex Data Processing hosts
    • Working with Apache Kafka® topics using Yandex Data Processing
    • Automating operations with Yandex Data Processing using Managed Service for Apache Airflow™
    • Shared use of Yandex Data Processing tables through Apache Hive™ Metastore
    • Transferring metadata across Yandex Data Processing clusters using Apache Hive™ Metastore
    • Importing, processing, and exporting Object Storage data to Managed Service for ClickHouse®
    • Migrating collections from a third-party MongoDB cluster to Yandex StoreDoc
    • Migrating data to Yandex StoreDoc
    • Migrating Yandex StoreDoc cluster from version 4.4 to 6.0
    • Sharding Yandex StoreDoc collections
    • Yandex StoreDoc performance analysis and tuning
    • Managed Service for MySQL® performance analysis and tuning
    • Syncing data from a third-party MySQL® cluster to Managed Service for MySQL® using Data Transfer
    • Migrating a database from Managed Service for MySQL® to a third-party MySQL® cluster
    • Migrating a database from Managed Service for MySQL® to Object Storage using Data Transfer
    • Migrating data from Object Storage to Managed Service for MySQL® via Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for MySQL® to Managed Service for Apache Kafka® using Debezium
    • Migrating a database from Managed Service for MySQL® to Managed Service for YDB using Data Transfer
    • MySQL® change data capture and delivery to YDS
    • Migrating data from Managed Service for MySQL® to Managed Service for PostgreSQL using Data Transfer
    • Migrating data from AWS RDS for PostgreSQL to Managed Service for PostgreSQL using Data Transfer
    • Migrating data from Managed Service for MySQL® to Yandex MPP Analytics for PostgreSQL using Data Transfer
    • Configuring an index policy in Managed Service for OpenSearch
    • Configuring a cold storage policy in Managed Service for OpenSearch
    • Migrating data from a third-party OpenSearch cluster to Managed Service for OpenSearch using Data Transfer
    • Loading data from Managed Service for OpenSearch to Object Storage using Data Transfer
    • Migrating data from Managed Service for OpenSearch to Managed Service for YDB using Data Transfer
    • Copying data from Managed Service for OpenSearch to Yandex MPP Analytics for PostgreSQL using Yandex Data Transfer
    • Migrating data from Managed Service for PostgreSQL to Managed Service for OpenSearch using Data Transfer
    • Authenticating a Managed Service for OpenSearch cluster in OpenSearch Dashboards using Keycloak
    • Using the yandex-lemmer plugin in Managed Service for OpenSearch
    • Sending email notifications in Managed Service for OpenSearch
    • Creating a PostgreSQL cluster for 1C:Enterprise
    • Searching for the Managed Service for PostgreSQL cluster performance issues
    • Managed Service for PostgreSQL performance analysis and tuning
    • Logical replication in PostgreSQL
    • Migrating a database from a third-party PostgreSQL cluster to Managed Service for PostgreSQL
    • Migrating a database from Managed Service for PostgreSQL
    • Migrating a Managed Service for PostgreSQL cluster to a different version
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Data Transfer
    • Delivering data from Managed Service for PostgreSQL to Managed Service for Apache Kafka® using Debezium
    • Delivering data from Managed Service for PostgreSQL to Managed Service for YDB using Data Transfer
    • Migrating a database from Managed Service for PostgreSQL to Object Storage
    • Migrating data from Object Storage to Managed Service for PostgreSQL via Data Transfer
    • PostgreSQL change data capture and delivery to YDS
    • Migrating data from Managed Service for PostgreSQL to Managed Service for MySQL® using Data Transfer
    • Migrating data from Managed Service for PostgreSQL to Managed Service for OpenSearch using Data Transfer
    • Fixing string sorting issues in PostgreSQL after a glibc upgrade
    • Using a Yandex Lockbox secret in a PySpark job to connect to Yandex Managed Service for PostgreSQL
    • Configuring permissions for access to a secret created by Connection Manager for a Managed Service for PostgreSQL user
    • Migrating a database from Greenplum® to ClickHouse®
    • Migrating a database from Greenplum® to PostgreSQL
    • Exporting Greenplum® data to a cold storage in Object Storage
    • Loading data from Object Storage to Yandex MPP Analytics for PostgreSQL using Data Transfer
    • Copying data from Managed Service for OpenSearch to Yandex MPP Analytics for PostgreSQL using Yandex Data Transfer
    • Creating an external table from a Object Storage bucket table using a configuration file
    • Getting data from external sources using named queries in Greenplum®
    • Migrating a database from a third-party Valkey™ cluster to Yandex Managed Service for Valkey™
    • Using a Yandex Managed Service for Valkey™ cluster as a PHP session storage
    • Loading data from Object Storage to Managed Service for YDB using Data Transfer
    • Loading data from Managed Service for YDB to Object Storage using Data Transfer
    • Processing Audit Trails events
    • Processing Cloud Logging logs
    • Processing Debezium CDC streams
    • Analyzing data with Jupyter
    • Processing files with usage details in Yandex Cloud Billing
    • Ingesting data into storage systems
    • Smart log processing
    • Data transfer in microservice architectures
    • Migrating data to Object Storage using Data Transfer
    • Migrating data from a third-party Greenplum® or PostgreSQL cluster to Yandex MPP Analytics for PostgreSQL using Data Transfer
    • Migrating Yandex StoreDoc clusters
    • Migrating MySQL® clusters
    • Migrating to a third-party MySQL® cluster
    • Migrating PostgreSQL clusters
    • Creating a schema registry to deliver data in Debezium CDC format from Apache Kafka®
    • Automating operations using Yandex Managed Service for Apache Airflow™
    • Working with an Object Storage table from a PySpark job
    • Integrating Yandex Managed Service for Apache Spark™ with Apache Hive™ Metastore
    • Running a PySpark job using Yandex Managed Service for Apache Airflow™
    • Using Yandex Object Storage in Yandex Managed Service for Apache Spark™
    • Using a Yandex Lockbox secret in a PySpark job to connect to Yandex Managed Service for PostgreSQL
    • Running a PySpark job in Yandex Managed Service for YTsaurus

In this article:

  • Required paid resources
  • Getting started
  • Migrating data using Yandex Data Transfer
  • Collection migration example
  • Configure the source cluster
  • Create and configure the target cluster
  • Set up the endpoints and transfer
  • Transfer the data
  • Delete the resources you created
  1. Building a data platform
  2. Migrating collections from a third-party MongoDB cluster to Yandex StoreDoc

Migrating collections from MongoDB to Yandex StoreDoc

Written by
Yandex Cloud
Updated at April 21, 2026
  • Required paid resources
  • Getting started
  • Migrating data using Yandex Data Transfer
  • Collection migration example
    • Configure the source cluster
    • Create and configure the target cluster
    • Set up the endpoints and transfer
    • Transfer the data
    • Delete the resources you created

To migrate collections from a third-party MongoDB cluster to your Yandex StoreDoc cluster, follow these steps: transfer the data, switch legacy databases to read-only mode, switch the workload to your Yandex Cloud cluster.

Required paid resourcesRequired paid resources

  • Yandex StoreDoc cluster: computing resources allocated to hosts, storage and backup size (see Yandex StoreDoc pricing).
  • Public IP addresses if public access is enabled for cluster hosts (see Virtual Private Cloud pricing).
  • Per transfer: Computing resources used and the number of data rows transferred (see Data Transfer pricing).

Getting startedGetting started

Make sure you can connect to the source cluster’s hosts from the internet.

Migrating data using Yandex Data TransferMigrating data using Yandex Data Transfer

  1. Prepare the source cluster.

  2. Prepare the target cluster.

  3. Create a source endpoint with the following parameters:

    • Database type: MongoDB.

    • Endpoint parameters → Connection settings: Custom installation.

      Configure the source cluster connection settings.

    Note

    Transferring of Time Series collections is not supported, so you should exclude such collections in the endpoint settings.

  4. Create a target endpoint with the following parameters:

    • Database type: MongoDB.

    • Endpoint parameters → Connection settings: Yandex StoreDoc cluster.

      Specify the ID of the target cluster.

  5. Create a Snapshot and increment-type transfer and configure it to use the previously created endpoints.

    To make large collections (over 1 GB) copy more quickly, enable parallel copy in the transfer settings. Specify two or more workers. The collection will be split into the specified number of parts that will be copied concurrently.

    For parallel copy to work, the _id field data type must be the same for all documents in the same collection. If a transfer discovers a type mismatch, the collection will not be partitioned but transferred in a single thread instead. If needed, remove documents with mismatched data types from the collection before starting a transfer.

    Note

    If a document with a different data type is added to a collection after a transfer starts, the transfer will move it at the replication stage after the parallel copy operation is completed. However, when re-activated, the transfer will not be able to partition a collection because the _id field type requirement will not be met for some of the documents in the collection.

  6. Activate the transfer.

  7. Wait for the transfer status to change to Replicating.

  8. Switch the source cluster to "read-only" mode and transfer the load to the target cluster.

  9. On the transfer monitoring page, wait for the Maximum data transfer delay metric to decrease to zero. This means that all changes that occurred in the source cluster after data copying was completed are transferred to the target cluster.

  10. Deactivate the transfer and wait for its status to change to Stopped.

    For more information about transfer statuses, see Transfer lifecycle.

  11. Delete the stopped transfer.

  12. Delete the source and target endpoints.

Collection migration exampleCollection migration example

  1. Configure the source cluster.
  2. Create and configure the target cluster.
  3. Set up the endpoints and transfer.
  4. Transfer data.
  5. Delete the resources you created.

Configure the source clusterConfigure the source cluster

  1. Connect to the mongos host on the MongoDB source cluster via mongosh.

  2. Create a database db1.

  3. Create a user with owner privileges for db1 and log in as that user:

    use admin
    db.createUser({
      user: "user1",
      pwd: passwordPrompt(),
      roles: [
          {
              role: "dbOwner",
              db: "db1"
          }
      ]
    })
    
    db.auth("user1")
    
  4. Populate collection1 in db1 with 200,000 random entries:

    use db1
    function randomName() {
      // Base 36 uses letters and digits to represent a number:
      return (Math.random()+1).toString(36).substring(2);
    }
    
    var day = 1000 * 60 * 60 * 24;
    function randomDate () {
      return new Date(Date.now() - (Math.floor(Math.random() * day)));
    }
    
    for (var i = 1; i <= 200000; ++i) {
      db.collection1.insertOne({
       name: randomName(),
       creationDate: randomDate(),
       uid: i
      });
    }
    

Create and configure the target clusterCreate and configure the target cluster

Non-sharded target cluster
Sharded target cluster
  1. Create a Yandex StoreDoc cluster with your preferred configuration.
  2. Create a database db1.
  3. Create a user named user_transfer with the readWrite role for the new database.
  1. Create a Yandex StoreDoc cluster with your preferred configuration. The cluster must have at least two hosts.
  2. Enable sharding.
  3. Create a database db1.
  4. Create a user named user_transfer with the readWrite role for your new database and the mdbShardingManager role for the admin database.
  5. Follow these steps to create and configure an empty sharded collection named collection1 in the db1 database.

Set up the endpoints and transferSet up the endpoints and transfer

Non-sharded target cluster
Sharded target cluster
  1. Create the endpoint for the source cluster:
    • Database type: MongoDB.
    • Connection settings: Custom installation.
      • CA certificate: If connecting to the source cluster requires encryption, upload the certificate file.
      • Host list: Specify the FQDNs of the source cluster’s hosts.
      • Port: Specify the port for connecting to the hosts.
      • Authentication source: db1.
      • User: user1.
      • Password: Enter the user1 password.
  2. Create the endpoint for the target cluster:
    • Database type: MongoDB.
    • Connection settings: MDB cluster.
      • Specify the target cluster ID.
      • User: user_transfer.
      • Password: Enter the user_transfer password.
      • Cleanup policy: Drop.
  3. Create a transfer:
    • Transfer type: Snapshot and increment.
    • Source: Select the endpoint you created for the source cluster.
    • Target: Select the endpoint you created for the target cluster.
  1. Create the endpoint for the source cluster:
    • Database type: MongoDB.
    • Connection settings: Custom installation.
      • CA certificate: If connecting to the source cluster requires encryption, upload the certificate file.
      • Host list: Specify the FQDNs of the source cluster’s hosts.
      • Port: Specify the port for connecting to the hosts.
      • Authentication source: db1.
      • User: user1.
      • Password: Enter the user1 password.
  2. Create the endpoint for the target cluster:
    • Database type: MongoDB.
    • Connection settings: MDB cluster.
      • Specify the target cluster ID.
      • User: user_transfer.
      • Password: Enter the user_transfer password.
      • Cleanup policy: Don't cleanup or Truncate.
  3. Create a transfer:
    • Transfer type: Snapshot and increment.
    • Source: Select the endpoint you created for the source cluster.
    • Target: Select the endpoint you created for the target cluster.

Transfer the dataTransfer the data

Non-sharded target cluster
Sharded target cluster
  1. Activate the transfer.

  2. Wait for the transfer status to change to Replicating.

  3. Switch the source cluster to read-only mode and transfer the workload over to the target cluster.

  4. On the transfer monitoring page, wait until the Maximum data transfer delay value drops to zero. This means that all changes made in the source cluster after the initial data copy have been transferred to the target cluster.

  5. Connect to the target cluster.

  6. Verify that collection1 has been transferred and contains 200,000 documents, matching the count in the source cluster:

    use db1
    db.collection1.countDocuments()
    
    200000
    
  1. Activate the transfer.

  2. Wait for the transfer status to change to Replicating.

  3. Switch the source cluster to read-only mode and transfer the workload over to the target cluster.

  4. On the transfer monitoring page, wait until the Maximum data transfer delay value drops to zero. This means that all changes made in the source cluster after the initial data copy have been transferred to the target cluster.

  5. Connect to the target cluster.

  6. Verify that collection1 has been transferred, that it contains 200,000 documents as in the source cluster, and that the documents are distributed across shards:

    use db1
    db.collection1.countDocuments()
    
    200000
    
    db.collection1.getShardDistribution()
    
    Shard rs01 at rs01/<host_1>
    {
      data: '7.05MiB',
      docs: 99752,
      chunks: 2,
      'estimated data per chunk': '3.52MiB',
      'estimated docs per chunk': 49876
    }
    ---
    Shard rs02 at rs02/<host_2>
    {
      data: '7.08MiB',
      docs: 100248,
      chunks: 2,
      'estimated data per chunk': '3.54MiB',
      'estimated docs per chunk': 50124
    }
    ---
    ...
    

Delete the resources you createdDelete the resources you created

Some resources are not free of charge. Delete the resources you no longer need to avoid paying for them:

  1. Deactivate the transfer and wait for its status to change to Stopped.

    To learn more about the transfer lifecycle, see this Yandex Data Transfer guide.

  2. Once the transfer is stopped, delete it.

  3. Delete the source and target endpoints.

  4. Delete the Yandex StoreDoc cluster.

Was the article helpful?

Previous
Running jobs from a remote host
Next
Migrating data to Yandex StoreDoc
© 2026 Direct Cursus Technology L.L.C.