thelastapi
Get started free

Export your app and leave any time: code, database and env

Export app code, a Postgres database snapshot, and environment variables anytime with the vibiz CLI or API to keep backups or migrate hosts.

On this page 9 sections

You can export your entire app—source code, Postgres database, and environment variables—anytime using the vibiz export command or the console. You get your original uploaded source files in a zip, a full Postgres database snapshot as gzipped plain SQL that restores directly with psql, and a complete guide to your configuration. There is no lock-in: you own your data, can download it on demand, and can take it to any server or provider you choose.

Whether you want an offsite disaster-recovery archive or you decide to move your infrastructure somewhere else, leaving requires no support tickets and no manual migrations.

What an export contains

When you run an export, the platform packages your project into clean, portable artifacts. It creates separate archives so your source code remains safe to share with teammates without exposing sensitive credentials.

The export generates:

  • Source code archive (<slug>-<env>-code.zip): The clean source tree of your live deployment (or an older deployment you pick). It includes your real code, not minified build output.
  • Migration and setup guide (VIBIZ-EXPORT.md): Documentation detailing every resource your project uses (hosting, database, sign-in, payments, email, AI models, files, analytics), local setup instructions, and steps for moving to another provider.
  • Environment blueprint (.env.example): A list of every variable name needed by your app in that environment with explanations of what each does. This file contains variable names only—never secret values.
  • Database snapshot (<slug>-<env>-database.sql.gz): A single consistent Postgres snapshot. It contains schemas, tables, every row, indexes, keys, functions, triggers, views, and sequence positions. It is generated without hardcoded roles or grants, meaning any Postgres user with table-creation privileges can restore it into an empty Postgres 15+ database.
  • Table CSVs (<slug>-<env>-database-csv.zip): An optional archive providing individual CSV files for each database table, complete with header rows.

Secrets and passwords are deliberately omitted from the code archive. If you are an account owner, you can export your actual secret values separately into a .env file using the --secrets flag.

How to export using the CLI

The simplest way to export your project is via the terminal using the @vibiz/cli.

Make sure you are logged in:

Terminal
vibiz login

To export your entire project (source code, Postgres dump, and documentation) for production:

Terminal
vibiz export

If you only need specific components or formats, use flags:

Terminal
# Export only the source code and export guide to a custom zip file
vibiz export --code -o shop.zip

# Export the database snapshot as SQL, plus CSV copies of every table
vibiz export --db --csv

# Include secret values in a separate .env file (requires full-access owner key)
vibiz export --secrets

If you are developing locally or testing in staging, specify the target environment:

Terminal
# Export the development branch and development guide
vibiz export --env development

The CLI requests the export, tracks the build progress, and downloads the signed links straight to your machine. For more details on local workflows, check the quickstart guide.

How to export from the web console or HTTP API

You can also trigger an export through the browser or script it directly against the HTTP API.

In the console, navigate to your project and open the Export page at /projects/<id>/export?env=production. Choose whether you want production or development, select your components (code, database, CSVs), and click to generate your files.

To trigger an export via curl:

Terminal
curl -X POST https://thelastapi.dev/v1/projects/prj_123/exports \
  -H "Authorization: Bearer $VIBIZ_API_KEY" \
  -H "content-type: application/json" \
  -d '{"include":["code","database","env_guide"],"env":"production"}'

This returns a 202 Accepted status with an export object:

JSON
{
  "object": "project_export",
  "id": "exp_01k123",
  "environment": "production",
  "include": ["code", "database", "env_guide"],
  "status": "queued"
}

Poll GET https://thelastapi.dev/v1/projects/prj_123/exports/exp_01k123 until status becomes ready. Once finished, the payload contains secure download links:

JSON
{
  "object": "project_export",
  "id": "exp_01k123",
  "environment": "production",
  "include": ["code", "database", "env_guide"],
  "status": "ready",
  "files": [
    {
      "kind": "database",
      "name": "shop-production-database.sql.gz",
      "size": 48211,
      "url": "https://thelastapi.dev/x/exp_01k123/shop-production-database.sql.gz?expires=1730000000&signature=abc..."
    },
    {
      "kind": "code",
      "name": "shop-production-code.zip",
      "size": 120533,
      "url": "https://thelastapi.dev/x/exp_01k123/shop-production-code.zip?expires=1730000000&signature=abc..."
    }
  ],
  "url_expires_at": "2026-10-29T10:00:00.000Z",
  "warnings": [],
  "console_url": "https://thelastapi.dev/projects/prj_123/export?env=production&export=exp_01k123"
}

The download URLs are signed and remain valid for 24 hours. After a day, files are deleted from the export cache and marked expired.

Permissions: full access vs limited keys

To protect sensitive user data, exports enforce strict permission boundaries depending on the API key permissions:

ItemLimited key (Agents, CI)Owner (Full-access key)
Code & documentationAllowed (Dev or Prod)Allowed
Development databaseAllowedAllowed
Production databaseDenied (403 owner_only)Allowed
Production secret values (.env)Denied (403 owner_only)Allowed (prompts for confirmation)

If an automated agent running with a Limited key calls vibiz export, it defaults to the development environment. If an agent tries to download production databases or secrets, the API returns 403 owner_only.

Restoring your database anywhere

Because the database dump is standard PostgreSQL, you are never locked into our database infrastructure. You do not need specialized transformation tools or proprietary schema engines to load it. Read more about backups in how to back up your Postgres database as SQL.

To restore your data into any clean PostgreSQL 15 or newer database, run:

Terminal
gunzip -c shop-production-database.sql.gz | psql "$NEW_DATABASE_URL"

Everything restores cleanly: tables, indexes, triggers, and sequences.

Running your code on external infrastructure

If you decide to run your site on another server or cloud provider while still keeping your database and other resources, you do not need to rewrite your application. See the cheapest way to host a website and database for a side project to compare your hosting architectures.

  1. Unpack your code zip file:
    Terminal
    unzip shop-production-code.zip -d my-app
    cd my-app
  2. Retrieve your production configuration values:
    Terminal
    vibiz env --write .env.production
  3. Run your application on your external server with the environment loaded, or use vibiz run:
    Terminal
    VIBIZ_APP_KEY=vz_app_... vibiz run -- npm start

If you ever wish to deploy your app elsewhere permanently, check deploy a Next.js app with a database and sign-in in one command for how environments and connections fit together. If your site stays on our hosting, you can track historical changes using version history for your website: see what changed and roll back.

Transferring custom domains

If you bought your custom domain directly through the platform, you legally own it. You can move its traffic to an outside server by pointing records, or unlock the domain and transfer registration entirely. Review our domains documentation and hosting documentation for details.

To point your custom domain to an external IP or server host:

Terminal
vibiz domains point app.example.com 192.0.2.1

To transfer your domain registration out to another registrar:

Terminal
vibiz domains transfer-code example.com

This returns the standard EPP authorization code needed by any external domain registrar. Note that ICANN rules keep all newly registered or recently moved domains locked for 60 days before an outbound transfer can be initiated.

Export limits to keep in mind

  • Frequency: Each project can run 1 active export at a time, up to 10 exports per day. Exceeding this returns a 429 rate_limited error.
  • Sizes: The export engine accommodates up to 1 GB of compressed code and up to 2 GB for the gzipped database.
  • Very large databases: For databases exceeding 2 GB, retrieve your DATABASE_URL using vibiz env and pipe standard pg_dump directly from your terminal:
    Terminal
    pg_dump "$DATABASE_URL" | gzip > backup.sql.gz
  • Link expiration: Signed download URLs remain valid for 24 hours. After that, you must trigger a new export.

You can check whether your site and all resources are operating normally before running an export by inspecting Mission Control and health checks or typing vibiz health.

To export your project right now, run vibiz export in your project folder, or create your account at thelastapi.dev/start to get started.

Frequently asked questions

Are production environment secrets included inside the standard code export zip?

No. Source code exports only include a `.env.example` file with variable names and descriptions. To download your actual production variable values into a `.env` file, an account owner must explicitly run `vibiz export --secrets` or use the Export page in the console.

What database version is required to restore an exported SQL dump?

The database snapshot is standard PostgreSQL SQL and restores into any empty PostgreSQL database running version 15 or newer using standard `psql`.

Can an AI agent or Limited key download my production customer database?

No. Limited keys cannot export production databases or production `.env` files and will receive a `403 owner_only` error. Limited keys are restricted to exporting development databases and code.

How long do export download links stay active?

Download URLs are signed links that stay active for 24 hours. After a day, the generated files are deleted and marked expired, requiring you to run a new export if you need fresh links.