Ability to restore a backup to a postgres container? #12906
Unanswered
brendonparker
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
Ha. I was able to get it to work, but feels super hacky.
var db = builder
.AddPostgres("db-server")
.WithDataVolume()
.WithContainerName("db-server")
.WithLifetime(ContainerLifetime.Persistent);
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Looking to see if anyone has guidance, or has done this...
I want to add a custom command that can restore a backup to the postgres container.
I have a pretty vanilla container:
Now I want to add a custom command that can restore a backup (from a
pg_dumpto that instance). Ideally, on demand (could be use for testing scenarios).Something like:
But from here, not sure what my implementation of RestoreDatabaseCommand should look like.
I think I want to run a command against that running container.
Something similar to:
Mostly tripped up on how to get the container name.
Anyone else done this? Or have alternative suggestion for how to approach?
Beta Was this translation helpful? Give feedback.
All reactions