Skip to content

Backing up database when not using docker-compose #2742

Answered by DrMichael
jdhorner asked this question in Q&A
Discussion options

You must be logged in to vote

This is obviously because I don't have a docker-compose.yml file any more. I tried changing it to just use docker, with the lower-case T option:

❯ sudo docker exec -t postgres pg_dump -U teslamate teslamate > ./teslamate.bck2

But that also doesn't work. It just exports the dump script itself into the backup file, instead of the actual DB "doing" stuff.

What's the right way to create a backup if I'm not using docker-compose? I thought it would be easy, but I'm obviously missing something. Thanks very much!

You need to use the container id instead of "postgres".

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
4 replies
@jdhorner
Comment options

@jdhorner
Comment options

@reuten75
Comment options

@reuten75
Comment options

Answer selected by jdhorner
Comment options

You must be logged in to vote
1 reply
@jdhorner
Comment options

Comment options

You must be logged in to vote
1 reply
@James62370
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants