1. Knowledge Base
  2. Documentation
  3. Import and Export Wizard

Import and Export Wizard

With Studio 3T, carry out your MongoDB import and export tasks without having to type a single command line using the following formats: JSON, CSV, SQL, BSON/mongodump, and another collection.

MongoDB import

Supported import formats

Studio 3T supports the following import file types:

  • JSON
  • CSV
  • BSON/mongodump

Additionally, data can be imported from:

  • A SQL database
  • Another collection

Ready to get started with your MongoDB import? Download Studio 3T here

Open the Import Wizard

After successfully connecting to a MongoDB database, there are two ways to open the Import Wizard:

Button

Click on Import in the Global Toolbar.

Right-click

Right-click on any server, database, or collection and choose Import.

Import JSON to MongoDB

  1.  With the import wizard open, tick the JSON box as the chosen import format.
  2.  The next screen allows for one or multiple JSON files to be imported. Click on to upload documents, – to remove them, and the clipboard icon to paste data from the clipboard.

    Studio 3T can validate JSON before import, but note that clipboard data cannot be validated before import.

  3. Under the Target Database, Target Collection, and Insertion Mode columns, double-click on a cell to select the appropriate database or collection, and define the insertion settings for the documents.
  4. Click Next. Studio 3T will show a preview of what the server will look like after import.
  5. The last screen will show an Import Summary and is the last chance to make edits.
  6. Once everything looks good, click Start import.

Import CSV (e.g. Excel) to MongoDB

  1. Choose CSV in the import wizard and click next.
  2. Here, specify the file to be imported as well as the import specifications.
  3. The next step is to choose desired delimiters and text qualifiers, then click Next.
  4. Choose the right CSV options and click Next.

    If you’re unsure about an option, click on the handy “info” button next to each option.

  5. All that is left now is to review the summary of what the new server will look like after the import is complete.
  6. Finally, begin the import.

Supported date formats

CSV import supports eight date formats:

  • ISO
  • Locale
  • MDY
  • DMY
  • YMD
  • MYD
  • DYM
  • YDM

The date format XXX supports all order variations of the year, month, and day fields, as well as three separators: “-“, “/” and “.”

Both ISO and Locale formats accept their respective variations like date only, date with short or long time, etc.

Upon CSV import, Studio 3T will try to detect a suitable date format for all the values of a column and will automatically use one based on the following criteria:

  • The above date formats are tested in the given order with all the values of a column/field
  • The first format to match all values is selected as suggested date type for the field or column

But of course, as with all data types, the selection can always be overriden.

Download Studio 3T to start your CSV import to MongoDB.

Import BSON/mongodump to MongoDB

  1. Open the import wizard and choose between BSON – mongodump folder or BSON – mongodump archive and click Next.

    Regardless of the option chosen, a ‘mongorestore’ executable will have to be accessible for this type of import to operate.

  2. Choose the mongodump folder or archive file to import and click Next. Make sure sure the mongodump folder doesn’t have any compressed files.
  3. If importing a folder: Choose the databases and collections to import, if applicable. If importing an archive file, jump to Step 5.
  4. A preview of what your server will look like after the import will appear. Click Next.
  5. Choose the mongorestore options and click Next.
  6. Review the import summary and click Start Import.

Import SQL to MongoDB

 

 

  1. Choose SQL Database in the import wizard.
  2. Here, connect to the SQL server, choose the SQL table and the target database, target collection, and import mode. Then, click Next.
  3. Define the import settings as needed in the Configure SQL Columns Import screen, then click Next.
  4. Preview the import, then click Next.
  5. Click Start Import.

SQL Import to MongoDB is a Pro and Enterprise feature. Learn more about the different Studio 3T editions.

Studio 3T supports all the major SQL databases: Oracle (Enterprise version only), Microsoft SQL Server, MySQL, and PostgreSQL.

Import another collection

  1. Open the import wizard and choose Another Collection.
  2. Then choose the location of the desired collection.
  3. Choose the target database and collection and decide how Studio 3T should deal with duplicate documents.
  4. Preview the server and read the import summary.
  5. Once everything looks good, start the import!

MongoDB export

Studio 3T lets you export the following data across the various Studio 3T features (e.g. Visual Query Builder, IntelliShell, Aggregation Editor):

  • Entire collection(s) or view(s)
  • Current query result
  • Specific documents

Supported export formats

Studio 3T supports the following formats:

  • JSON
  • CSV
  • SQL
  • mongodump
  • To another collection

Open the Export Wizard

Similar to the Import Wizard, the Export Wizard can be accessed two ways:

Button

Click on Export found in the Global Toolbar.

Right-click

Right-click on any server, database, or collection and choose Export.

Studio 3T also has the option of saving and loading frequently-used export job settings. Settings can be saved on the last page of the export wizard, or loaded from the first page of the export wizard.

Export MongoDB to JSON

When exporting MongoDB to JSON, you have the option of either exporting:

  • JSON mongo shell / Studio 3T
  • JSON mongoexport

Exporting JSON mongo shell/Studio 3T exports a collection to a rich, type-conserving collection.json file, in the JSON format used in the mongo shell, which makes for an easy paste job.

Exporting JSON mongoexport produces a JSON format that the mongoexport tool generates.

  1. Choose JSON in the export wizard and click Next.
  2. Choose between JSON mongo shell/Studio 3T or JSON mongoexport.
  3. Choose the export target file destination and click Next
  4. Review the export summary and click Start Export.

Export MongoDB to CSV (e.g. Excel)

  1. Choose CSV in the export wizard and click Next.
  2. Choose your CSV format options and click Next.
  3. Here, choose the fields to be exported and click Next.
  4. Choose the target file destination for the export and click Next.
  5. Review the export summary and click Start Export. Choose where the data should be exported to, or simply export to Clipboard.

Ready to export MongoDB to CSV? Get the latest version of Studio 3T.

Export MongoDB to SQL

Export MongoDB to SQL is a feature available in Studio 3T Pro and Enterprise.

    1. Open the export wizard, choose SQL, and click Next.
    2. Name your SQL table and choose your SQL format.
    3. Choose the fields to be exported.
    4. Studio 3T matches the Source Type with the closest SQL type, but can be manually overriden. Rename the SQL column if needed.
    5. Review the export summary and click Start Export.

Studio 3T supports all the major SQL databases: Oracle, Microsoft SQL Server, MySQL, and PostgreSQL. Choose whether you want to add statements for Create or Drop Table, or to use and auto-incremented, additional column as a primary key.

Export MongoDB to BSON/mongodump

  1. Open the export wizard, choose mongodump, and click Next.
  2. Choose between two export options: BSON – mongodump folder or BSON – mongodump archive.
  3. Select the export target folder or archive file.
  4. Review the export summary and click Start Export

Export to another collection

  1. Open the export wizard and choose Another Collection.
  2. Choose the target database, target collection and export mode, then click Next.
  3. Read over the Export Summary and once everything looks good, click Start Export.

Check out other time-saving Studio 3T features:

Updated on November 20, 2018

Was this article helpful?

Related Articles