diff --git a/etc/db/README.md b/etc/db/README.md index 0797d11..cd5af47 100644 --- a/etc/db/README.md +++ b/etc/db/README.md @@ -76,6 +76,17 @@ sudo -u postgres /usr/lib/postgresql14/bin/pg_upgrade --link \ --old-datadir="/srv/pgsql/data/" \ --new-datadir="/srv/pgsql/data14/" +# NOTE: If getting the following error: +# lc_collate values for database "postgres" do not match: old "en_US.UTF-8", new "C" +# then: +# cd .. +# rm -rf /srv/pgsql/data14 +# install -d -m 0700 -o postgres -g postgres /srv/pgsql/data14 +# cd /srv/pgsql/data14 +# sudo -u postgres /usr/lib/postgresql14/bin/initdb --locale=en_US.UTF-8 . +# +# and repeat the migration command + # After successfully migrating the data... cd .. # if not already symlinked move the old data to a versioned directory matching @@ -95,3 +106,34 @@ systemctl start postgresql.service # For good measure: sudo -u postgres /usr/lib/postgresql14/bin/vacuumdb --all --analyze-in-stages ``` + +# Restoring from backup + +## Whole database + +Ensure that nothing is connected to the database. + +```bash +psql -U postgres --dbname postgres <