Skip to content
Last updated

Legacy Bulk Import From Mongodb

This article explains how to dump data from MongoDB and import it into Treasure Data.

Install Legacy Bulk Import

First, install the Toolbelt, which includes bulk loader program, on your computer.

Downloads

After the installation, the td command will be installed on your computer. Open up the terminal, and type td to execute the command. Also, make sure you have java as well. Execute td import:jar_update to download the up-to-date version of our bulk loader:

$ td
usage: td [options] COMMAND [args]
$ java
Usage: java [-options] class [args...]
$ td import:jar_update
Installed td-import.jar 0.x.xx into /path/to/.td/java

Dump

Use the mongoexport command to export a collection into JSON (default) or CSV format as shown below:

$ mongoexport --db users --collection contacts --out /tmp/result.json
$ mongoexport --db users --collection contacts --csv --out /tmp/result.csv

For more information, consult the MongoDB documentation.

Bulk Import from CSV file or JSON file

Refer Bulk Import from CSV files about how to import CSV files or Bulk Import from JSON files about how to import JSON files.

For further details, check the following pages: