Home United States USA — software Migrating From Sakila-MySQL to Couchbase – ETL

Migrating From Sakila-MySQL to Couchbase – ETL

105
0
SHARE

This post covers setting up the MySQL Sakila database, extracting the data into a JSON or CSV format, and loading data into Couchbase. Let’s look at the steps.
Join the DZone community and get the full member experience. Part 1 covers setting up the MySQL Sakila database, extracting the data into a JSON or CSV format, and loading that data into Couchbase. Let’s look at the steps. https://dev.mysql.com/downloads/ export PATH=$PATH:/usr/local/mysql/bin Download the Sakila database from – https://dev.mysql.com/doc/index-other.html. Use the schema and data in SQL files and load them using the MySQL shell. We can use the MySQL shell and figure out how to directly extract data to JSON. First, let’s look at the command to extract the data. We can also extract to CSV using 3306 is the default port on which MySQL is running. We use a mix of bash and MySQL Shell to extract each table into a list of JSON objects. To extract into CSV we can use the above SQL query in the MySQL shell. This will make it in a list format that is then easy for us to import into Couchbase using cbimport. We need to run the above commands to import data from all the tables present in the Sakila database. Some important things to be aware of when importing data: Once we have data in either JSON or CSV formats it’s easy to load this data using CB-import. With the addition of Collections in Couchbase 7.

Continue reading...