Lompat ke konten utama

Easily Import Data to DocumentDB

Diposting pada 14 April, 2015

Program Manager, Azure Service Health

A common request we’ve heard from customers is, “How can I easily migrate data to DocumentDB?”  While there are lots of different approaches, it’s hard to imagine one easier than the DocumentDB Data Migration tool, an open source solution that imports data to DocumentDB from a variety of sources, including:

  • JSON files
  • MongoDB
  • SQL Server
  • CSV files
  • DocumentDB collections

Setting up an import through the tool’s graphical user interface (dtui.exe) is a simple operation. Choose the import source and provide the applicable information: source source2 Specify import options: target1 Confirm the import settings and click Import: confirm confirmimportsettings The tool can also be driven from the command line (dt.exe). In fact, after setting up an import through the UI, there is an option to output the associated command: command What's more, the tool supports transforming tabular source data (e.g. SQL Server or CSV files) such that hierarchical relationships (subdocuments) can be created during import, as well as, options for handling date fields. The migration tool source code is available on GitHub and a compiled version is available from Microsoft Download Center.  You may either compile the solution or simply download and extract the compiled version to a directory of your choice. For full details on how to use the tool, including command line samples for each data source option, head over to my article here.  To learn more about DocumentDB, please visit our service page.