Closed StarWar closed 9 years ago
We switched to using this plugin to get this functionality: https://github.com/Kloadut/dokku-pg-plugin
Which is strange because its syntax actually matches jeffutter's mongodb plugin syntax more closely than this one. We were using his mongodb plugin first, so we initially installed this one for postgres, but were surprised to find out that the other plugin matched the mongodb syntax more closely. It was the lack of importing that initially led us to look elsewhere.
Importing with this plugin is not much different than importing using postgresql natively. The trick is that when connecting to localhost postgresql will tend to try and connect over a unix socket rather than a tcp socket. To import you can do something like this (off the top of my head, might not be exact)
psql -f dump.sql -h localhost -p 5432 -U admin target_db
I personally don't have much use to bake importing into the script. If someone would like to contribute this functionality I would gladly accept it.
An easier solution would be to implement commands in this script to dump/restore databases. If anyone wants to work on this I would appreciate it.. There is an open pull request about to be merged on my mongodb plugin for this feature that someone could use for inspiration: https://github.com/jeffutter/dokku-mongodb-plugin/pull/67
I implemented dump
and dump_all
. See #18
Fixed in #18
:smile_cat:
I'm using this plugin and I was able to install it. And now I want to import my existing database and I don't see any command here to import sql dump in this plugin.