Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I pass --data-only --table when doing a dump? #21

Open
sglebs opened this issue Dec 3, 2015 · 6 comments
Open

How can I pass --data-only --table when doing a dump? #21

sglebs opened this issue Dec 3, 2015 · 6 comments
Labels

Comments

@sglebs
Copy link

sglebs commented Dec 3, 2015

How can I perform a dump as described in https://feeding.cloud.geek.nz/posts/restoring-single-table-from-postgres/ , passing --data-only and --table ?

I would like to pass these parameters on dump and, in some cases, on restore as well (when restoring from full dumps).

If you can provide an example, that would be great. Thanks!

@sglebs
Copy link
Author

sglebs commented Dec 3, 2015

FOr the record, this did not work for me:

dokku psql:dump softdispdjango-dev --data-only --table=dashboard_system --table=dashboard_systemdependency  > softdispdjango-dev.dump

@Flink
Copy link
Owner

Flink commented Dec 4, 2015

Well you can’t, the dump and restore commands are done like it works on heroku. What you can do is to use directly pg_dump and pg_restore in the container via docker exec.
You could do something like docker exec -i psql-single-container pg_dump --data-only … > database.dump I think

@Flink Flink added the question label Dec 4, 2015
@sglebs
Copy link
Author

sglebs commented Dec 10, 2015

dokku 0.4.5 via vagrant installs in such a way that docker commends are failing.

vagrant@dokku-vagrant:~$ docker ps
Cannot connect to the Docker daemon. Is the docker daemon running on this host?

Doing some RTFM to figure things out.

@Flink
Copy link
Owner

Flink commented Dec 10, 2015

You have to use sudo to use docker :)

@sglebs
Copy link
Author

sglebs commented Dec 10, 2015

d'oh of course!

@sglebs
Copy link
Author

sglebs commented Dec 10, 2015

For the record, I am only trying to do this because of the problems I had in ticket #22 with a regular, full dump&restore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants