Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi!
So it sounds like you are using the Dokku postgres plugin. If that’s the case, then to dump a database, you’ll need to do it with Dokku as it is running inside a container.
dokku postgresql:dump dbname > foo.sql
and to restore one:
dokku postgresql:restore dbname < foo.sql
As to the question of will dokku postgresql:create original_db_name will destroy the old one, looking at the code:
if [[ -f "$DOKKU_ROOT/.postgresql/volume_$APP" ]]; then
VOLUME="`cat $DOKKU_ROOT/.postgresql/volume_$APP`:/opt/postgresql"
echo
echo "-----> Reusing postgresql/$APP database"
else
VOLUME="/opt/postgresql"
# Generate a random password for DB user
DB_PASSWORD=$(< /dev/urandom tr -dc A-Za-z0-9 | head -c 16)
echo $DB_PASSWORD > "$DOKKU_ROOT/.postgresql/pwd_$APP"
chown dokku: "$DOKKU_ROOT/.postgresql/pwd_$APP"
chmod 700 "$DOKKU_ROOT/.postgresql/pwd_$APP"
fi
it looks like it will attempt to reuse the persistent volume.