⚠️Exporting Your Data

This guide explains how to export all your data from bkend — table records and uploaded files — using your AI tool or the REST API directly.


Before You Start

What data can you export?

Data Type
Description

Table records

Rows stored in your custom tables

File storage

Files you uploaded via the bkend Storage API

💡 System tables (accounts, sessions, users, files) are managed by bkend internally. Focus on the custom tables you created.

Which method is right for you?

Method A: REST API
Method B: AI Tools

Table discovery

Manual (check Console)

Automatic via MCP

Requirements

curl

AI tool with MCP support

Compatible tools

Any terminal

Claude Code, Cursor, VS Code, etc.

Best for

Developers comfortable with curl

Anyone using an AI coding tool

💡 Using Claude Code, Cursor, or another MCP-compatible AI tool? → Start with Method B. Your table names are discovered automatically — no need to check the Console manually.

What you'll need

  • Publishable Key (pk_...) — Console → your project → API Keys

  • Your bkend account email and password

Find your table names

💡 If you're using Method B (AI Tools), skip this step. Your AI tool discovers table names automatically via MCP.

There is no REST API for listing tables. Check the Console directly:

  1. Go to your project → Database

  2. Note down all your custom table names


Method B: AI Tools + bkend MCP

If you use an MCP-compatible AI tool (Claude Code, Cursor, VS Code, etc.), this is the fastest option. The AI tool will discover your tables automatically and generate export scripts for you.

Step 1: Connect bkend MCP

Setup instructions vary by tool. Follow the guide for yours:

MCP Setup Guide — Claude Code, Cursor, VS Code, and more

For Claude Code:

Step 2: Authenticate

Follow your tool's authentication flow as described in the MCP Setup Guide.

For Claude Code:

Select bkendAuthenticate. Your browser will open — log in and approve the connection.

Step 3: Ask your AI tool to export your data

The AI tool will retrieve your table names via MCP, generate an export script, and run it.

Step 4: Verify the output


Method A: REST API Export

Step 1: Get an Access Token

Response:

Copy the data.accessToken value — you'll use it in all subsequent requests. The token expires in 1 hour; re-run this step if you get a 401 error.

For more detail, see Email Sign-in.


Step 2: Export Table Data

Run this for each custom table. Replace the placeholders with your values.

Response:

Repeat with page=2, page=3, ... until data.pagination.hasNext is false. See Sorting & Pagination for details.

Script: export all pages automatically

Save as export-table.sh and run bash export-table.sh:

Run once per table, changing the TABLE value each time.


Step 3: Export File Storage

List all your files

Each item in data.items includes a file id and originalName.

Get a download URL for each file

Response:

Download using data.url:

For more detail, see File Download.

Script: download all files automatically

Save as export-files.sh and run bash export-files.sh:

💡 This script requires jq. Install with brew install jq (macOS) or apt install jq (Ubuntu/Debian).


FAQ

How do I check how much data I have?

Console → your project → Database. Each table shows a row count. For files, check Storage.

I have multiple projects or environments. Do I need to export each one separately?

Yes. Each project and environment (Production/Staging) has its own Publishable Key. Repeat the export steps for each environment using the corresponding PK Key. Switch between projects in the Console to find each environment's key.

My access token expired in the middle of the export.

Access tokens are valid for 1 hour. If the token expires while the script is running, re-run Step 1 to get a new token, update the ACCESS_TOKEN value in the script, and restart from the last page that was saved successfully.

Will files with the same name overwrite each other?

Yes. export-files.sh saves files using originalName, so duplicate names will overwrite each other. If you're concerned about this, modify the save line in the script to include the file ID:

I'm getting a 401 or 403 error.

  • Make sure your X-API-Key starts with pk_ (not sk_)

  • Access tokens expire after 1 hour — re-run Step 1 to get a new one

  • 403 data/permission-denied means the table has RLS restrictions; ensure you're passing the Authorization header

Can I access my data after May 15, 2026?

No. All data will be permanently deleted when the service shuts down. Export your data before the deadline.

I need help.

Email us at support@bkend.ai.

Last updated