Skip to content
Download

Import and export ​

Export rows to a file ​

Export is in the toolbar of an open table or collection, in the header of a query result and in the job results panel.

  1. Click Export.
  2. In Export result, pick a File format: CSV, JSON, JSONL or Excel.
  3. Under Rows to export, choose:
    • All rows: the complete result, not only the loaded page. For a table, the current filters and sort order apply.
    • Current page: the rows you see now.
    • Selected rows: the rows you selected in a table.
  4. Click Export and choose where to save the file.

When the export finishes, a notification shows the row count and the file path. If a query result says The complete result is no longer available, run the query again to export all rows.

For a job result, CSV is offered only when the result is a list of rows.

What the files contain:

  • CSV: UTF-8 with a byte order mark and a header row. A value that starts with =, +, - or @ gets a leading ', so spreadsheet apps do not run it as a formula.
  • JSON: one array of objects. JSONL: one object per line.
  • Excel: an .xlsx workbook with one sheet named Data. Numbers stay numbers.

In CSV and Excel, nested objects and arrays become JSON text and binary values become Base64.

Import a file ​

The import wizard reads CSV, TSV, JSON, JSONL, XML, XLSX and XLS files into a table or collection. Open it in one of these ways:

  • open a table or collection and click Import in the toolbar;
  • in the explorer, right-click a table or collection and choose Import;
  • right-click the Tables or Collections group to import into a new object.

The wizard has six steps. Click a finished step at the top to go back to it.

  1. Source. Click Choose an import file.

  2. Structure. Check Parsing settings against Source preview: Encoding, Delimiter and headers for text files, Record path for JSON and XML, Worksheet and Formula cells for Excel. Click Refresh preview after a change, then Next.

  3. Destination. Choose Existing object and pick a Table or collection, or choose Create a new table (Create a new collection in MongoDB) and enter an Object name.

  4. Mapping. For each source field, turn Use on or off and pick the Target field. Conversion sets NULL markers, boolean values, number separators, date format and time zone.

  5. Write. Choose the Write mode:

    • Append adds rows.
    • Create object creates the new table or collection first.
    • Replace contents replaces all existing rows after a confirmation.
    • Upsert updates rows that match the Conflict keys and adds the rest. ClickHouse does not offer it.

    Set Invalid source rows to Stop import or Skip invalid. Write guarantee tells you whether a failure rolls back the whole write. Click Validate all rows to check the file without changing the database, then Start import.

  6. Result. The summary counts inserted, updated, skipped and failed rows. Open destination shows the data. View rejected rows lists the errors, and you can export them with Export CSV or Export JSONL, fix them and load them back with Import corrected rows.

An XLSX file can be up to 500 MB and an XLS file up to 50 MB. One record can hold up to 5,000 fields and 10 MB.

Copy data between connections ​

You can copy rows into the same or another connection without a file:

  • in the explorer, right-click a table or collection and choose Copy data to copy all rows;
  • in an open table, select rows and click Copy selected rows;
  • in a query result, open Result actions next to Export and choose Copy data.

In the Copy data dialog, choose the Target connection, enter the Target object name, pick Append to existing object or Create target object and click Copy data.

See also Results and editing. GridFS files have their own upload and download, described in MongoDB.