Database - Copy to Server

04 Aug 25

dump, scp to server, restore (ensuring correct user specified)

pg_dump -Fc --no-acl --no-owner -d technical_diary_development -f latest.dump

-Fc: custom format for efficient restores (rather than human readable .sql file)

scp latest.dump simbed-server:apps/technical-diary/

pg_restore --no-owner --clean -U railsapps -d technical_diary_production latest.dump  (prompt for password)
railsapps is the user has specified in production.rb
postgres user has authority over the databse, so can do: sudo -u postgres dropdb technical_diary_production (but shouldnt be necessary)