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
- gotosocial and postgresql need to be installed
pkg_add gotosocial-- postgresql-server--
- gotosocial must not be running
rcctl stop gotosocial
steps
- 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
- 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
- restore the mediafiles
su -s /bin/ksh -l _gotosocial
tar -xzvf <gotosocial_media>.tar.gz -C /