Skip to content

Conversation

@dalenewby
Copy link
Contributor

No description provided.

restore.sh used DB_USER to create an empty DB if needed.  This failed
but AWS RDS ended up doing the right thing anyway.  The script now uses
DB_ROOTUSER and the default postgres DB when creating the target DB.
The application was upgraded to use Alpine 3.15 and the PostgreSQL 12
client to be compatible with previous backup files.
Update the documentation. Upgrade the DB server to Alpine 3.15 and
PostgreSQL 11.15. Provide an updated test database.

start=$(date +%s)
psql --host=${DB_HOST} --username=${DB_USER} --dbname=${DB_NAME} ${DB_OPTIONS} < /tmp/${DB_NAME}.sql || STATUS=$?
psql --host=${DB_HOST} --username=${DB_ROOTUSER} --dbname=postgres ${DB_OPTIONS} < /tmp/${DB_NAME}.sql || STATUS=$?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README still refers to DB_NAME. Is that OK?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. DB_NAME is the name of the DB we want to restore which will be in the DB backup file (${DB_NAME}.sql). The --dbname=postgres is required since the DB backup file DROPs $DB_NAME before creating it and you can't drop a DB that you are connected to.

@dalenewby dalenewby merged commit b41486a into master Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants