thelastapi
Get started free

No lock-in: how to take your app elsewhere

Avoid vendor lock-in by using standard Postgres, OpenAI-compatible AI, portable env files, and full database and code exports with the vibiz CLI.

On this page 7 sections

You avoid backend vendor lock-in by building on standard interfaces, keeping your data in portable formats, and choosing a platform that lets you export your entire project on demand. On thelastapi, you are never trapped inside a proprietary runtime. You can download your source code, dump your complete Postgres database to standard SQL, and extract your environment configurations whenever you want. If your needs change, you can move your hosting, switch individual services, or take your entire application to independent infrastructure without rewriting your code.

This guide walks through how backend lock-in happens, how to run a complete export, and how to migrate your app or run services individually.

What creates backend lock-in

Lock-in rarely happens on purpose. It happens when convenient conveniences couple your app to proprietary systems:

  • Proprietary databases. Some platforms offer specialized document stores or relational dialects that cannot be restored into standard Postgres. Leaving requires writing custom extraction scripts and rewriting queries.
  • Custom auth and user tables. When user identity, password hashes, and session logic are trapped inside an opaque third-party service, migrating accounts without breaking logins is difficult.
  • Specialized client SDKs. Many cloud backends require proprietary SDKs for files, payments, or AI. Switching to a new provider means refactoring every API call and handling new error shapes across your codebase.
  • Tied domains and hosting. Some providers couple DNS management and custom domains directly to their own application servers, making it hard to host your frontend in one place and your backend in another.

thelastapi prevents this by relying on open standards. Your database is standard Postgres. Your AI calls use the standard OpenAI request shape. Your environment variables follow regular .env conventions. You can read more about building on a single interface in one key for your whole app: the one-API stack for indie builders.

How to export your entire application

When you want a complete copy of your project—either to move elsewhere or to keep an offline backup—you can export everything from the CLI or the console.

Run vibiz export from your project folder:

Terminal
vibiz export                      # code + guide + database, saved here
vibiz export --code -o shop.zip   # just the code (with the guide)
vibiz export --db --csv           # the database as SQL and each table as CSV
vibiz export --secrets            # also the env's values, in their own file (full-access key; asks first)

You can also run an export from the project's Export page in the console at /projects/<id>/export?env=production, or via the HTTP API:

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"}'

Every full export produces a clear bundle of files:

FileContents
<slug>-<env>-code.zipThe exact source code of the deployment as uploaded, containing VIBIZ-EXPORT.md and .env.example.
<slug>-<env>-database.sql.gzA complete, consistent Postgres snapshot with tables, rows, indexes, views, and functions.
<slug>-<env>-database-csv.zipAn optional zip file containing each table exported as an individual CSV file.
VIBIZ-EXPORT.mdA summary detailing every service used, local setup steps, and instructions for moving.
.env.exampleA documented list of every variable name required by the app in that environment (values omitted).

Downloads are provided as signed URLs that remain valid for 24 hours. For details on programmatic export calls, see the Export documentation.

Restoring your Postgres database anywhere

Your database snapshot is not a proprietary dump. It is a standard, consistent SQL file generated without hardcoded table owners or permissions. Any Postgres user with table creation privileges can restore it into an empty Postgres instance (version 15 or newer).

To restore your production database to any self-hosted or managed Postgres server:

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

Because the SQL dump preserves sequence positions, foreign key constraints, triggers, and custom views, your schema and data come back intact. If your database grows beyond the 2 GB export snapshot limit, you do not need the export bundle to move: you can run a standard pg_dump directly using your project's DATABASE_URL.

Managing production secrets and environment variables

By default, an export zip file excludes secret values. This is an intentional security guard so you can safely distribute code exports to contractors or teammates without leaking sensitive credentials. The .env.example file names every variable your application needs to run.

When you are ready to migrate production workloads, an account owner with a full-access key can download the live secrets into a private .env file:

Terminal
vibiz export --secrets

The CLI asks for confirmation before writing the file. In the console, you can use the Download .env button on the Export page, or fetch values directly using GET /v1/projects/:id/exports/:exportId/env?confirm=1.

The generated VIBIZ-EXPORT.md document outlines the exact dependencies your application relies on:

  1. Local execution: How to install dependencies and run the application locally.
  2. Hybrid setup: How to host the frontend anywhere while continuing to use individual thelastapi backend services with a single VIBIZ_APP_KEY.
  3. Full migration: Step-by-step instructions for replacing sign-in, payments, email, and files with alternative providers.

Moving piecemeal instead of a full rewrite

Avoiding lock-in does not mean you must execute an all-or-nothing migration. Because every service on thelastapi functions independently, you can move your application piece by piece.

For example, you can deploy your frontend to an external server while keeping your database, sign-in, and AI gateway intact. Learn more about running standalone services in use just one service from an app hosted anywhere.

Connecting an external host

Tell thelastapi that your app is running elsewhere:

Terminal
vibiz domains add app.example.com --elsewhere

Your app connects back to thelastapi using @vibiz/app and a single environment variable, VIBIZ_APP_KEY:

TypeScript
import { vibiz } from '@vibiz/app';

// Load variables on external hosts
await vibiz.loadEnv();

Alternatively, you can pull production variables into your CI/CD pipeline or build step:

Terminal
npx @vibiz/cli env pull --format dotenv -o .env.production

Portability across core services

ServiceProtocol / FormatHow to switch
DatabaseStandard Postgres (DATABASE_URL)Restore shop-production-database.sql.gz to any Postgres 15+ instance.
AI GatewayOpenAI-compatible (/v1/ai)Update baseURL to another provider in your existing OpenAI SDK client. Learn more in adding AI features to your SaaS without vendor lock-in.
FilesPermanent HTTPS linksDownload files via vibiz files download <id> -o path or keep public URLs intact. See file uploads for your app, with permanent links.
DomainsStandard DNS registrarRun vibiz domains transfer-code <domain> to release the domain to another registrar.

If you purchased a custom domain through the platform, you own that registration. You can transfer it out at any time:

Terminal
vibiz domains transfer-code example.com

This command returns the standard authorization code required by other domain registrars to initiate an incoming transfer.

Export limits and permissions

The export tool includes clear limits to ensure stability and protect sensitive data:

  • Rate limits: One export can run at a time per project, with a limit of ten exports per day.
  • Size limits: Code archives can be up to 1 GB compressed. Database snapshots can be up to 2 GB compressed (use pg_dump for larger databases).
  • Download link lifetime: Download links expire after 24 hours. If a link expires, you can generate a fresh export.
  • Key access levels: Limited keys (used by agents or automated tools) default to the development environment. A Limited key cannot export production databases or production .env secrets; hitting those endpoints returns 403 forbidden with details.reason: "owner_only". Full access requires an owner key. Review Keys and environments for permission details.

You own your data and code from day one. You can use the unified API to build fast, and you can export or separate your infrastructure whenever your business demands it.

To create an account and start building, go to thelastapi.dev/start.

Frequently asked questions

Can I restore the exported database into any standard Postgres provider?

Yes. The export produces a standard compressed SQL file without hardcoded table owners or grant constraints, allowing you to restore it into any empty Postgres 15 or newer database using psql.

Do export downloads include my secret API keys and passwords?

By default, the exported zip file includes only code, database dumps, and a .env.example file with variable names. Account owners can optionally download active production values into a separate .env file using the console or the vibiz export --secrets command.

Can an AI agent or Limited key download my production data?

No. Limited keys can only export development environments and development databases. Requests for production databases or secret values return a 403 forbidden error with owner_only details.

How do I move a domain I purchased through thelastapi to another registrar?

Run vibiz domains transfer-code <domain> using a full-access key to retrieve the standard EPP authorization transfer code required by external registrars.