kamal db:pull, db:push etc (for pg and more?) #1240
Replies: 3 comments 2 replies
-
This is amazing. If it can't be part of Kamal, perhaps Kamal can introduce some kind of plugins or add-ons, similar to what Dokku does? Oh wait, @dhh already mentioned hooks here |
Beta Was this translation helpful? Give feedback.
-
I think it's great to build stuff on top of Kamal, and share secrets with it, but I'm not sure what form any additional integration would take. It's totally fine just to shell out to Kamal to drive it from secondary scripts. |
Beta Was this translation helpful? Give feedback.
-
actually, reflecting on this with @kennethgeerts, we concluded that kamal would just need something like rake has, a means to list contributed commands that are 'provided' by the gems in the project. or similar to rails that lists the available generators, provided by installed gems. |
Beta Was this translation helpful? Give feedback.
-
i understand it's not the core of kamal maybe, it still is strongly related to having a full alternative for heroku, i.e. the ability to easily pull and push databases from environments for debugging reasons for example.
below is a script that provides us with the same convenience for our setup. it reads the database credentials for the kamal secrets but for the rest it's kind of kamal agnostics. it provides pull, push, copy, backup, rename functionality for your kamal environments.
there's also a 'console' command that opens a psql straight to the remote db, which is actually faster then launching the rails db console on the host and it's also more convenient for the case where you want to save/load e.g. from local CSV files.
first of all, feel free to use it as is or as inspiration, to anyone interested.
i'm curious where @dhh thinks this kind of functionality would ideally be made shareable? for us, these scripts where kind of one of the key missing parts to comfortably migrate away from heroku to hetzner, and i'm assuming that many others would be making the jump more easily if they have these available.
currently it's PG specific, but conceptually at least, pulling and/or pushing a database from local to a destination is useful for independent.
the script is here: #1164 (comment)
Beta Was this translation helpful? Give feedback.
All reactions