Last active
September 21, 2020 12:12
-
-
Save nicokruger/7ecb6ced45677f3995373be87cd5318b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
list databases: \l *; | |
non-binary way: | |
export PGPASSWORD=whatever | |
for F in $(cat dbs); do echo $F; psql -h dt-rds-test.coivvuccn9hs.eu-west-1.rds.amazonaws.com -v -U postgres -d ${F} < ${F}.sql ; done | |
binary way: | |
https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/PostgreSQL.Procedural.Importing.html | |
# above way doesnt seem to work with roles etc. | |
psql -h database-2.coivvuccn9hs.eu-west-1.rds.amazonaws.com -v -U postgres -d postgres < alldb.dump ; | |
pg_dumpall -h localhost -p 5033 -U postgres > alldb.dump | |
for F in $(ls *xml); do sed -i "s;sql:\/\/.*?\/;sql:\/\/database-2.coivvuccn9hs.eu-west-1.rds.amazonaws.com\/;g" $F; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment