• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

Migrating from MongoDB to Amazon DocumentDB

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
Modern applications today often use document databases. For years, MongoDB has been the preferred choice for developers to build applications using JSON-like document data structures. However, a move to a fully managed service like Amazon DocumentDB is attractive when workloads increase.

Built from the ground up, Amazon DocumentDB (with MongoDB compatibility) is highly available, robust, and scalable. It supports common MongoDB drivers and tools, making it easy to move teams without changing application code. This article will guide you step-by-step through migrating data from MongoDB to Amazon DocumentDB using the AWS Database Migration Service (DMS).

Prerequisites


Before you begin the migration, make sure you have the following:

An Amazon DocumentDB cluster already created and available in your AWS account.

We will use AWS Database Migration Service (DMS) to migrate data from a MongoDB database to Amazon DocumentDB. This will work with minimal downtime and will not require the export and import of collections manually.

Create an AWS DMS Replication Instance for MongoDB Migration


The replication instance is responsible for the actual migration process. It establishes a connection to the source and target endpoints, extracts the data, transforms it (if necessary), and then inserts it into the destination.

  • Access the AWS DMS Console and navigate to the Replication instances section.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



  • Select "Create replication instance."


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



  • Pick an instance identifier and select an instance class, such as dms.t3.medium.
  • Select the appropriate virtual private cloud (VPC). This must be the same VPC that your DocumentDB cluster refers to as its home.
  • Multi-AZ should be activated when exceptional availability is required.
  • Select the "Create" button and await the "Available" status of the instance.
Create Source and Target Endpoints for MongoDB Migration


Once the replication instance is ready, create source and target endpoints to define where the data will be moved from and to.

Source Endpoint (MongoDB):


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



  • Endpoint type: Source
  • Engine: MongoDB
  • Server name: MongoDB hostname or IP address
  • Port: 27017
  • Database name: your MongoDB database (e.g., zips-db)
  • Authentication mode: default
  • Username and password: credentials for your MongoDB instance

Target Endpoint (Amazon DocumentDB):


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



  • Endpoint type: Target
  • Engine: MongoDB
  • Server name: your DocumentDB cluster endpoint (e.g., mydocdbcluster.cluster-xxxxxx.docdb.amazonaws.com)
  • Port: 27017
  • Database name: target database name
  • Authentication: enter your DocumentDB admin username and password
  • TLS mode: verify-full
  • TLS CA file: upload global-bundle.pem

To add TLS CA file first, download the global CA certificate. You can find the TLS certificate download command directly in the Amazon DocumentDB console under your cluster's Connectivity & security tab.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



After both endpoints are created, test the connections to verify that DMS can reach each database.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Create and Run a MongoDB Migration Task


Now, you can define and launch the migration task.

In the DMS Console, go to Database migration tasks and click Create task.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Choose a task identifier, and select your previously created replication instance.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.


For migration type, choose one of the following:

Migrate existing data only


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Important: Turn off data validation. This feature is not supported for MongoDB endpoints.

Under Table mappings, click Add new selection rule (you must select at least one) :


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.


Schema: your MongoDB database name (e.g., zips-db)

Source table name: % to migrate all collections or specify one (e.g., zips)

Action: Include

Choose to start the task automatically on create.

Once created, the task will begin migrating your data to Amazon DocumentDB. You can monitor progress via the DMS console and view logs for detailed insights.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.



Wrapping Up


AWS DMS makes migrating from MongoDB to Amazon DocumentDB a simple task. Following the procedures outlined above will help you to reduce downtime and transfer your document-based workloads to a completely controlled environment that grows with your requirements. DocumentDB gives you the AWS security, scalability, and dependability advantages without compromising MongoDB compatibility.

This move can be the next step in developing your architecture if you are thinking about integration with other AWS services, operational simplicity, and long-term maintenance.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу