Skip to main content
The My Data tab is where you look at and change what’s in your database. In the Project Editor, select Tools, then Database under Replit Cloud. Select a database, then My Data. You can work visually or run SQL directly.
To edit production data, select the production database, open My Data, and turn on Enable Editing. Be careful: this is your live app’s real data.
This example shows the navigation in a development database with no application tables yet: Database selected under Replit Cloud, with Development Database, My Data, SQL console, Database studio, and an empty public schema

Browse and modify data visually

In My Data, select Database studio to browse and modify data visually with Drizzle Studio. These visual tools help you avoid syntax errors and offer the following functionality:
  • Filter and sort data to focus on specific information
  • Export data to a file for external use. To export your whole production database, see Export your production database.
  • Insert or modify row data
  • Create and manage schema, tables, views, and enums

Run SQL commands

The SQL console lets you run SQL commands on your database and view the results.
From the Database tool:
  1. Select the My Data tab
  2. Select SQL console
To run a query, enter the SQL statement in the text area and select Run. For a read-only example that doesn’t change your app’s data, use:
The result contains one row with example_value set to 1: SQL console with SELECT 1 AS example_value, the Run button, and a returned row containing 1
You don’t need to write SQL yourself. Ask Agent to query or change your development data. Agent has read-only access to your Replit-managed production database; it can’t change production data for you.

Export your production database

Export your production database to keep your own copy of its data. For example, keep an offline backup or move your data to another service. Choose one of these options:
If your database is very large, Agent and the Shell may not be able to export it. They save the export inside your project before you download it, so a very large export can run out of space, with an error such as No space left on device, or be too large to download. To see how big your database is, open the Database tool, then Settings, and check Storage. For a very large database, download your tables one at a time from the Database tool, which saves them straight to your computer.

Download tables from the Database tool

  1. In the Database tool, make sure Production Database is selected.
  2. Open My Data.
  3. Select the table you want to export.
  4. Open the menu (⋯) at the top right of the table.
  5. Select Export all to .csv, Export all to .json, or Export all to .xlsx. The file downloads to your computer, named after the table.
Database tool with Production Database selected, the My Data tab open, the customers table selected, and the table menu showing Export all to .json, .csv, and .xlsx CSV and .xlsx files open in spreadsheet apps such as Excel or Google Sheets. Repeat these steps for each table you want to keep. Exporting doesn’t change your data, so you don’t need to turn on Enable Editing. A large table can take a while, so keep the page open until the download finishes.

Ask Agent to export your data

Agent can save every table in your production database as a CSV file. It reads production without changing it, so you don’t need a connection string. Paste this prompt into Agent:
Prompt
To confirm the export came from production, check that a record you recently created in your live app appears in the CSV files. Then open the library in the top-right corner of your workspace, select Files, select the menu (⋮) next to the exports folder, select Download folder, and then select Delete.

Export from the Shell

Exporting from the Shell is an advanced procedure. It uses commands and your database password. If you’re not comfortable with that, download your tables from the Database tool or ask Agent instead.
This is the only option that saves a full backup of every table in one file, which you can later restore to another PostgreSQL database.
1

Copy your production connection string

In the Database tool, make sure Production Database is selected, open Settings, and select the copy button next to Connection string. When asked, select Copy anyway.Database tool with Production Database selected, the Settings tab open, and the Connection string copy button highlighted
The connection string includes your database password. Don’t share it, and don’t save it in Secrets, where collaborators and Agent can read it.
2

Run the export

Open the Shell and follow these steps. They keep your password out of your Shell history.
  1. Run read -rs PROD_URL. The Shell waits without showing anything.
  2. Paste your connection string and press Enter. Nothing appears, which is expected.
  3. Run the export:
Replit Shell with read -rs PROD_URL, the pg_dump command, and ls listing the exported production-backup.sql fileWhen the prompt comes back without an error, the export is done. To check, run ls -lh production-backup.sql, which shows the file and its size. It’s a text file with your tables and data, so you can open it in any text editor.
3

Download the file and clean up

Open the library in the top-right corner of your workspace and select Files. Select the menu (⋮) next to production-backup.sql, then select Download. Open the menu again and select Delete, because the file contains all of your production data.Files panel opened from the top-right corner, with the menu next to production-backup.sql showing Download and DeleteDownload and delete the file right away, before Agent or a checkpoint saves it to your project history. Finally, close the Shell to clear the connection string you pasted.
PROD_URL is empty, so pg_dump tried your development database instead. Closing the Shell clears it. Run read -rs PROD_URL again, paste the connection string, press Enter, and rerun the command.
Your project doesn’t have the PostgreSQL tools installed. Ask Agent to install the PostgreSQL client tools, then run the command again.

Next steps