Databases
How can I setup automatic backups for my app?
Take a look at: https://hatchbox.gitbook.io/hatchbox/apps/backups
Where do I find my database credentials?
If you open your App in Hatchbox, click on Resources -> Database and all the details for connecting to your database will be listed there.
How can I manually backup my app database?
Backing up your database manually is pretty easy but takes a couple steps.
To find your Database
First, SSH into your server. Then we'll run pg_dump to dump our database. This will make a compressed dump of our database so it's smaller and easier to manage.
You'll now have a file called database.bak
that you can download from the server.
On your local machine, you can use the following command to download the file from the remote server to the current directory your local machine.
How can I restore a backup of my database?
Similar to the above, but in reverse order
First, you'll copy your database up to the server using:
Then SSH into the server and run one of the following commands:
If your database already exists, you can run this command to restore to it:
If your database does not exist, you can run this command to create the database and restore it:
Last updated