Digital ID
Latest

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

Gotosocial Backup

📆
🏷
, , ,

purpose and application

Backing up gotosocial.

definitions

None.

steps

  1. Backup db pg_dump -W postgres://gotosocial@127.0.0.1:5432/gotosocial | gzip > /var/tmp/gotosocial_$(date +%Y%m%dT%H%M%S).psql.gz
  2. Backup media files gotosocial admin media list-attachments --config-path /etc/gotosocial.yaml --log-level fatal | xargs tar -cvzf /var/tmp/gotosocial-media_$(date +%Y%m%dT%H%M%S).tar.gz

Resources