Gotosocial Restore

📆
🏷
, ,

purpose and application

Restore gotosocial on OpenBSD from a backup done via the following [procedure|https://brank.me/runbooks/gotosocial-backup/]

definitions

None.

prerequisites

  1. gotosocial and postgresql need to be installed pkg_add gotosocial-- postgresql-server--
  2. gotosocial must not be running rcctl stop gotosocial

steps

  1. create the database
su -s /bin/ksh -l _postgresql
psql -U postgres
create database gotosocial with locale 'C.UTF-8' template template0;
create user gotosocial;
\password gotosocial
grant all privileges on database gotosocial to gotosocial;  
\connect gotosocial
grant create on schema public to gotosocial;
\q
  1. restore the database backup and create statistics for the optimizer
gzip -dc <gotosocialdump.psql.gz> | psql --set ON_ERROR_STOP=on -U gotosocial gotosocial
psql -c 'ANALYZE VERBOSE' -U gotosocial gotosocial
exit
  1. restore the mediafiles
su -s /bin/ksh -l _gotosocial
tar -xzvf <gotosocial_media>.tar.gz -C /

Resources

--EOF