Database Import/Export
Appliku provides a built-in PostgreSQL migration tool for copying data between database instances. You can also perform manual imports and exports using standard PostgreSQL tools.
Built-in Migration Tool
Appliku has a built-in tool for migrating data between PostgreSQL instances managed by Appliku. This is useful when:
- Moving an application to a different server
- Upgrading to a newer PostgreSQL version
- Copying data from a staging to production database (or vice versa)
To use the migration tool:
- Open the Appliku dashboard
- Navigate to the database you want to migrate
- Use the Migrate option to copy data to another Appliku-managed PostgreSQL instance
- Appliku handles the
pg_dumpandpsqlsteps automatically
Manual Export (pg_dump)
To export a PostgreSQL database manually, use pg_dump via Docker. The connection URL is available in your application's environment variables.
Export to a compressed file
docker run --rm postgres:16 sh -c \
"pg_dump --no-privileges --no-owner --no-acl <postgresql_url> | gzip" > backup.sql.gz
Export to a plain SQL file
docker run --rm postgres:16 sh -c \
"pg_dump --no-privileges --no-owner --no-acl <postgresql_url>" > backup.sql
The flags used:
--no-privileges-- Excludes permission statements from the dump--no-owner-- Excludes ownership information--no-acl-- Excludes access control lists
These flags make the dump portable across different PostgreSQL instances where usernames and roles may differ.
Manual Import (psql)
Import from a compressed file
gunzip backup.sql.gz
psql <target_postgresql_url> < backup.sql
Import from a plain SQL file
psql <target_postgresql_url> < backup.sql
Import via Docker
If psql is not installed locally, use Docker:
docker run --rm -v $(pwd):/data postgres:16 sh -c \
"psql <target_postgresql_url> < /data/backup.sql"
Importing from an External Database
To import data from a database hosted outside Appliku (e.g., AWS RDS, Heroku, a VPS):
-
Export from the external database:
pg_dump --no-privileges --no-owner --no-acl <external_postgresql_url> | gzip > export.sql.gz -
Get the Appliku database URL from your application's environment variables in the dashboard
-
Import into the Appliku database:
gunzip export.sql.gz
psql <appliku_postgresql_url> < export.sql
Ensure the PostgreSQL versions are compatible. Importing a dump from a newer PostgreSQL version into an older one may fail. When in doubt, use the same major version for both source and target.
Tips
-
Large databases: For large exports, use the custom format (
-Fc) withpg_dumpand restore withpg_restorefor parallel processing:pg_dump -Fc --no-privileges --no-owner --no-acl <url> > backup.dump
pg_restore -d <target_url> --no-privileges --no-owner --no-acl backup.dump -
Schema only: Export just the schema without data using
--schema-only:pg_dump --schema-only --no-privileges --no-owner <url> > schema.sql -
Single table: Export a specific table with
-t:pg_dump -t my_table --no-privileges --no-owner <url> > table.sql
Next Steps
- Database Backups -- Schedule automatic backups
- PostgreSQL -- PostgreSQL provisioning guide
- Database Management Overview -- All supported database engines