Last active
April 18, 2016 17:00
-
-
Save brain90/8e26c63f6fdf08431ecd4b8de255f9c7 to your computer and use it in GitHub Desktop.
Deploy DB ke client, dengan preloaded data hanya sistem dan master table.
This file contains hidden or 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
##### Pada SOURCE_DB ##### | |
# Dump hanya schema saja dari seluruh object | |
$ pg_dump -Fc -U hcsuser -h localhost -s hcs_latest > hcs_latest_schema_only.dump --verbose | |
# Dump hanya konten dari object yg diinginkan (ex: sys tables, dan master table) | |
$ pg_dump -U hcsuser -h localhost -a -t user -t roles -t menu_roles -t master_* hcs_latest > hcs_master_content.sql --verbose | |
##### Pada TARGET_DB ##### | |
# Create database | |
postgres=# create database client_hcs_db owner hcs_user; | |
# Restore skema | |
$ pg_restore -U hcsuser -h localhost -d client_hcs_db < hcs_latest_schema_only.dump --verbose | |
# Restore sys tables dan master tables | |
$ psql -U hcsuser -h localhost client_hcs_db < hcs_master_content.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment