With Studio 3T, carry out your MongoDB import tasks without having to type a single command line in the following formats: JSON, CSV, BSON/mongodump, SQL, and another collection.
Supported import formats
Studio 3T supports the following import file types:
Additionally, data can be imported from:
- A SQL database
- Another collection
Open the Import Wizard
After successfully connecting to a MongoDB database, there are two ways to open the Import Wizard:
- Click on Import in the Global Toolbar or
- Right-click on any server, database, or collection and choose Import
Import JSON to MongoDB
- With the import wizard open, tick the JSON box as the chosen import format.
- 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.
- 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.
- Click Next. Studio 3T will show a preview of what the server will look like after import.
- The last screen will show an Import Summary and is the last chance to make edits.
- Once everything looks good, click Start import.
Import CSV to MongoDB (e.g. Excel)
- Choose CSV in the import wizard and click next.
- Here, specify the file to be imported as well as the import specifications.
- The next step is to choose desired delimiters and text qualifiers, then click Next.
- Choose the right CSV options and click Next.
- All that is left now is to review the summary of what the new server will look like after the import is complete.
- Finally, begin the import.
Supported date formats
CSV import supports eight date formats:
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.
Import BSON/mongodump to MongoDB
- Open the import wizard and choose between BSON – mongodump folder or BSON – mongodump archive and click Next.
- Choose the mongodump folder or archive file to import and click Next. Make sure sure the mongodump folder doesn’t have any compressed files.
- If importing a folder: Choose the databases and collections to import, if applicable. If importing an archive file, jump to Step 5.
- A preview of what your server will look like after the import will appear. Click Next.
- Choose the mongorestore options and click Next.
- Review the import summary and click Start Import.
Import SQL to MongoDB
- Choose SQL Database in the import wizard.
- Here, connect to the SQL server, choose the SQL table and the target database, target collection, and import mode. Then, click Next.
- Define the import settings as needed in the Configure SQL Columns Import screen, then click Next.
- Preview the import, then click Next.
- Click Start Import.
Import another collection
- Open the import wizard and choose Another Collection.
- Then choose the location of the desired collection.
- Choose the target database and collection and decide how Studio 3T should deal with duplicate documents.
- Preview the server and read the import summary.
- Once everything looks good, start the import!