[TOOLS] For delete content, restore local_groups and actor_subscriptions

This commit is contained in:
Hugo Sales 2022-03-01 17:57:39 +00:00
parent 87354c06bf
commit 802a8d124a
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -85,6 +85,7 @@ backup-actors:
sh -c "cd /var/www/social && bin/console doctrine:query:sql \"\
copy actor to '/tmp/backup/actor.csv'; copy local_user to '/tmp/backup/local_user.csv';\
copy activitypub_actor to '/tmp/backup/ap_actor.csv'; copy activitypub_rsa to '/tmp/backup/ap_rsa.csv';\
copy actor_subscription to '/tmp/backup/actor_subscription.csv'; copy local_group to '/tmp/backup/local_group.csv';\
copy (SELECT 'ALTER SEQUENCE ' || c.relname || ' RESTART WITH ' || nextval(c.relname::regclass) || ';'\
FROM pg_class c WHERE c.relkind = 'S') to '/tmp/backup/sequences';\"" && \
mkdir -p /tmp/social-sql-backup && \
@ -97,6 +98,7 @@ restore-actors:
sh -c "cd /var/www/social && bin/console doctrine:query:sql \"\
copy actor from '/tmp/backup/actor.csv'; copy local_user from '/tmp/backup/local_user.csv';\
copy activitypub_actor from '/tmp/backup/ap_actor.csv'; copy activitypub_rsa from '/tmp/backup/ap_rsa.csv';\
copy actor_subscription from '/tmp/backup/actor_subscription.csv'; copy local_group from '/tmp/backup/local_group.csv';\
`cat /tmp/social-sql-backup/sequences`\""
force-nuke-everything: down remove-var remove-file up flush-redis-cache database-force-nuke install-plugins