From a7d92dde3d1bd774def6cab88a8f3d7fb658c62b Mon Sep 17 00:00:00 2001 From: vangberg Date: Mon, 15 Jun 2026 10:58:15 +0200 Subject: [PATCH] DEVELOPMENT.md: instructions on loading production db dump --- DEVELOPMENT.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 0fc1691d..af99d95d 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -43,6 +43,23 @@ Start Rails: bin/rails server ``` +## Restore a production dump + +To replace the development database with a production SQL dump: + +```bash +bin/rails db:drop db:create + +gzip -dc ../registry-YYMMDD.sql.gz \ + | sed 's/OWNER TO registry;/OWNER TO registry_test;/g' \ + | bin/rails db + +bin/rails db:migrate +``` + +The ownership replacement is needed because production objects belong to the +`registry` Postgres role, while development uses `registry_test`. + ## Configuration ### External API's