Taxonomy Icon

Databases

Migrating data is never easy. Luckily, IBM Cloud has helped solve this issue with the IBM Data Connect service. IBM Data Connect is a fully managed, data preparation and data integration service. In this how-to guide, we will use one of IBM Data Connect’s key features, its ability to migrate data from two endpoints.

Learning objectives

This tutorial will demonstrate how to:

  • Use IBM’s Data Connect service to migrate data from a MySQL database to a Cloudant NoSQL database on IBM Cloud.

Prerequisites

Estimated time

It will take less than 30 minutes to complete this how-to; however, to completely migrate all data from the source database to the target database will depend on your network throughput.

Steps

Creating connections in IBM’s Data Connect

  1. Create an instance of IBM’s Data Connect service in IBM Cloud, and launch the service’s dashboard.

  2. Upon launching the service, select the Connections option in the menu, and begin to create a new one by clicking the Create New button. There will be many options for data connections, select the MySQL option.

  3. Provide the following information about your MySQL database: hostname or IP address, port, database name, username, password. Give the connection a memorable name and description and select Create Connection.

  4. If you haven’t done so already, create a Cloudant NoSQL instance in IBM Cloud.

  5. Now we will create another connection to the new Cloudant database. The steps will be similar to those in step 2, except we will select IBM Cloudant this time. Additionally, we will provide the following information: Cloudant URL, username and password. These can be retrieved by viewing the Cloudant service and selecting the Service credentials tab.

We now have the source and target database connections established in IBM’s Data Connect service. Time to start migrating our data!

Migrating data between connections

  1. From the IBM Data Connect dashboard, select the Refine & Copy option on the left menu. This will bring up a set of panels that begin the migration process.

  2. Choose the source database you want to migrate, in this case the MySQL one.

  3. Select the tables and views that are to be migrated and click Copy to Target.

  4. Choose the target database, in this case the Cloudant one and click Run.

This process can take seconds, minutes or hours depending on the size of the database and internet speed. When the process is completed, the data will be successfully migrated to the Cloudant service.

![](https://wdc.objectstorage.softlayer.net/v1/AUTH_7046a6f4-79b7-4c6c-bdb7-6f68e920f6e5/Code-Tutorials/migrate-data-from-on-premises-mysql-to-cloudant/images/cloudant2.png)

Summary

Congratulations! You now know how to migrate a database to IBM Cloud using IBM Data Connect. IBM Data Connect has many options for data sources, data preparation, shaping data, and moving data, be sure to try out these other features!