I'm able to push my database from my local machine to my heroku app with pg:transfer like this:
heroku pg:transfer --from postgres://localhost/idx_map_development --to aqua
But I don't want to upload the whole database, I only want to upload the properties table, is this possible using pg:transfer? If so how would the above line look?
did it with pg_dump:
pg_dump -Fc --no-acl --no-owner -h localhost -U username -t properties idx_map_development > properties.dump
The file called properties.dump gets only the data for the properties table and I upload the file to an Amazon S3 bucket and can then push it to heroku with this:
heroku pgbackups:restore DATABASE 'https://s3.amazonaws.com/bucket_name/properties.dump'
The other tables on my heroku db are unaffected. You don't need to specify the properties table in the pgbackups:restore
command.
As was mentioned by @eugjill, this doesn't work anymore. So first you do the dump, as described by @railsy:
pg_dump -Fc --no-acl --no-owner -h localhost -U username -t properties idx_map_development > properties.dump
Then instead of using pgbackups, use the pg_restore:
PGPASSWORD=<PASSWORD> pg_restore --verbose --no-acl --no-owner -h <HOST> -U <USER> -d <DATABASE> -p <PORT> properties.dump
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With