Skip to content
Snippets Groups Projects
Unverified Commit d3f79af6 authored by Jeff Bruemmer's avatar Jeff Bruemmer Committed by GitHub
Browse files

docs - csv uploads (#31629)

parent b23bf2b0
Branches
Tags
No related merge requests found
......@@ -58,6 +58,7 @@ Metabase's reference documentation.
- [Encrypting your database connection](./databases/encrypting-details-at-rest.md)
- [SSH tunneling](./databases/ssh-tunnel.md)
- [SSL certificate](./databases/ssl-certificates.md)
- [Uploading data](./databases/uploads.md)
### Questions
......
......@@ -40,6 +40,10 @@ Guidance on timezone settings.
Set language, datetime, and currency settings.
## [Uploads](../databases/uploads.md)
Allow people to upload data to collections.
## [Appearance](./appearance.md)
Customize colors, fonts, and other visual elements.
......
docs/databases/images/upload-icon.png

76.6 KiB

......@@ -8,6 +8,14 @@ title: Databases overview
Connect to and manage your databases.
## [Database users, roles, and privileges](./users-roles-privileges.md)
Bundling your privileges into roles based on use cases makes it easier to manage privileges in the future.
## [Syncing and scanning databases](./sync-scan.md)
Metabase runs different types of queries to stay up to date with your database.
## [Encrypting your database connection](./encrypting-details-at-rest.md)
Learn how to encrypt your database connection credentials at rest.
......@@ -19,3 +27,7 @@ Metabase can connect to some databases by first establishing a connection to a s
## [SSL certificate](./ssl-certificates.md)
You can connect your Metabase Cloud or self-hosted instance to a database using Secure Socket Layer (SSL) encryption with a certificate.
## [Uploading data](./uploads.md)
You can set Metabase up so you can upload CSV files to a database.
---
title: Uploading data
---
# Uploading data
You can upload data in CSV format to Metabase and start asking questions about it. This feature is best suited for ad hoc analysis of spreadsheet data. If you have a lot of data, or will need to update or add to that data regularly, we recommend setting up a way to load that data into a database directly, then connecting Metabase to that database.
## Enabling uploads
There are a few things admins need to do to support CSV uploads:
- [Connect to a database using a database user account with write access](#connect-to-a-database-using-a-database-user-account-with-write-access). This way Metabase will be able to store the uploaded data somewhere.
- [Select the database and schema you want to store the uploaded data in](#select-the-database-and-schema-that-you-want-to-store-the-data-in).
- (Optional) [specify a prefix for Metabase to prepend to the uploaded tables](#specify-a-prefix-for-metabase-to-prepend-to-the-uploaded-tables).
### Databases that support uploads
- [PostgreSQL](../databases/connections/postgresql.md)
- [MySQL](../databases/connections/mysql.md)
### Connect to a database using a database user account with write access
To upload data to Metabase, an admin will need to connect your Metabase to a database that supports uploads using a database user account that has write access to that database.
You can also upload data to the Sample Database included with Metabase (an H2 database), though we don't recommend using the Sample Database for any data that you want to keep around.
For more, check out:
- [Adding and managing databases](./connecting.md)
- [Database users, roles, and privileges](./users-roles-privileges.md)
### Select the database and schema that you want to store the data in
If Metabase is connected to a database using a database user account with write access, Admins can enable uploads by:
- Clicking on the **gear** icon in the upper right on the home page and navigating to **Admin settings** > **Settings** > **Uploads**.
- Selecting the database Metabase should use to store the data.
When people upload a CSV to a collection, Metabase will:
- Create a table to store that data in the database and schema that the Admin selected to store uploads.
- Create a [model](../data-modeling/models.md) that wraps the uploaded table, and save that model to the collection the person uploaded the CSV data to.
### Specify a prefix for Metabase to prepend to the uploaded tables
Admins can optionally specify a string of text to add in front of the table that Metabase creates to store the uploaded data.
## File size limit
CSV files cannot exceed 200 MB in size.
> Note that while Metabase limits uploads to 200 MB, the server you use to run your Metabase may impose a separate limit. You may need to change your server settings to allow uploads up to 200 MB. People on Metabase Cloud don't have to worry about this.
If you have a file larger than 200 MB, the workaround here is to:
1. Split the data into multiple files.
2. Upload those files one by one. Metabase will create a new model for each sheet.
3. Consolidate that data by creating a new question or model that joins the data from those constituent models created by each upload.
## Deleting models and tables created by uploads
### Models
You can archive a model by clicking on the three dots in the upper right and selecting **Archive**.
For deleting models completely, see [Deleting items permanently](../exploration-and-organization/history.md#deleting-items-permanently).
### Tables
You'll need to drop that table in the database itself (not in Metabase). For how to delete tables, see your database's documentation.
## Note on uploading data to a MySQL database
For speeding up uploads to a MySQL database, we recommend that you set a `local_infile` to `ON`. You'll need to set this `local_infile` in MySQL, not Metabase. The command-line format is `--local-infile=ON`.
If `local_infile` is disabled (set to `OFF`), Metabase will automatically fall back to uploading CSVs in a much slower way.
For more context, check out:
- [Non-LOCAL Versus LOCAL Operation](https://dev.mysql.com/doc/refman/8.0/en/load-data.html#load-data-local)
- [Reference docs for the local_infile variable](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_local_infile)
- [Security Considerations for LOAD LOCAL DATA](https://dev.mysql.com/doc/refman/8.0/en/load-data-local-security.html
......@@ -64,6 +64,16 @@ Note that you have to have Curate permission for the collection that you're movi
You can add events to collections, and organize those events into timelines. See [Events and timelines](events-and-timelines.md).
## Uploading data
You can upload CSV data by clicking on the **Upload** icon in the top right of the collection page.
![Upload CSV data](../databases/images/upload-icon.png).
Metabase will create a [model](../data-modeling/models.md) that contains that CSV data, as well as the model's underlying table.
Uploads will only be available if your admin has enabled uploads for your Metabase. See [Uploading data](../databases/uploads.md).
## Further reading
- [Keeping your analytics organized](https://www.metabase.com/learn/administration/same-page)
......
docs/exploration-and-organization/images/our-analytics-page.png

142 KiB | W: | H:

docs/exploration-and-organization/images/our-analytics-page.png

151 KiB | W: | H:

docs/exploration-and-organization/images/our-analytics-page.png
docs/exploration-and-organization/images/our-analytics-page.png
docs/exploration-and-organization/images/our-analytics-page.png
docs/exploration-and-organization/images/our-analytics-page.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -69,8 +69,8 @@ const Header = () => (
<SettingHeader
id="upload-settings"
setting={{
display_name: t`Allow users to upload data to Collections`,
description: jt`Users will be able to upload CSV files that will be stored in the ${(
display_name: t`Allow people to upload data to Collections`,
description: jt`People will be able to upload CSV files that will be stored in the ${(
<Link
className="link"
key="db-link"
......
......@@ -99,7 +99,7 @@ describe("Admin > Settings > UploadSetting", () => {
it("should render a description", async () => {
setup();
expect(
screen.getByText("Allow users to upload data to Collections"),
screen.getByText("Allow people to upload data to Collections"),
).toBeInTheDocument();
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment