...
$ RAILS_ENV=production bundle exec sufia_import -d /opt/sufia-project/import/gf_batch_0 --json_mapping Chf::Import::GenericFileTranslator=generic_file_
Postgres export/Import
On Staging
- Run the following to generate the export.
pg_dump -U postgres chf_hydra -Fp > chf_hydra_dump.sql
On Migration
From your machine runĀ
scp -3 -i /path/to/test.pem ubuntu@staging:~/chf_hydra_dump.sql ubuntu@new_box_ip:~
- Run this command to get into postgres (password for user is stored elsewhere)
psql -U postgres
- Inside Postgres generate the database and required permissions
CREATE DATABASE chf_hydra;
GRANT Create,Connect,Temporary ON DATABASE chf_hydra TO chf_pg_hydra
- Then enter \q to quit
- Finally import the data you copied over with scp
psql _U postgres chf_hydra < chf_hydra_dump.sql
Misc.
Postgres
You can get a list of all tables and fields with the command:
...