DockHostingDocs
Databases

Import an existing database

Move your data from another host, or from your computer, into a DockHosting database.

You restore a dump from your computer, so the database needs public access (Hobby and up) while you import.

Make a dump of your current database

pg_dump --no-owner --no-acl -Fc "$OLD_DATABASE_URL" -f backup.dump

Create the database and turn on public access

Create a database of the same engine (and the same major version or newer), then turn on Public access and copy its Public URL. See Connect from your computer.

Restore

pg_restore --no-owner --no-acl -d "$NEW_PUBLIC_URL" backup.dump

Link the database to your project (Database → Link a database), delete any old DATABASE_URL you set yourself in Variables, and redeploy.

On the Free plan?

Free databases can't be reached from outside. Import with a short script your app runs once on start, or upgrade for the import and switch back later.

On this page