Skip to content

Commit

Permalink
add DB backup instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
czue committed Aug 24, 2024
1 parent 3ed50b6 commit ece3908
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions deployment/kamal.md
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,26 @@ To change your site's URL, do the following:

Your app should now be running on your new domain.

#### Getting a database backup

Here is one way to get a database dump of your server:

First you can run the following command to save a database dump to the *host* machine:

```
kamal accessory exec postgres 'pg_dump -h localhost -p 5432 -U <your_app_user> <your_app_db_name> > db_dump.sql' --reuse
```

This should create a file on the host at `/home/kamal/db_dump.sql`.

If you want to copy this file locally, you can run:

```
scp [email protected]:db_dump.sql ./
```

Note: you may want to zip or gzip this file first if you have a large database.

#### Deploying multiple apps to the same server

One of the major benefits of the VPS-based approach is that you can easily host multiple apps on the same hardware,
Expand Down

0 comments on commit ece3908

Please sign in to comment.