1 # Database maintenance tasks
3 Every command should be ran with a prefix, in case of OTP releases it is `./bin/pleroma_ctl database` and in case of source installs it's `mix pleroma.database`.
5 ## Replace embedded objects with their references
7 Replaces embedded objects with references to them in the `objects` table. Only needs to be ran once if the instance was created before Pleroma 1.0.5. The reason why this is not a migration is because it could significantly increase the database size after being ran, however after this `VACUUM FULL` will be able to reclaim about 20% (really depends on what is in the database, your mileage may vary) of the db size before the migration.
10 $PREFIX remove_embedded_objects [<options>]
14 - `--vacuum` - run `VACUUM FULL` after the embedded objects are replaced with their references
16 ## Prune old remote posts from the database
18 This will prune remote posts older than 90 days (configurable with [`config :pleroma, :instance, remote_post_retention_days`](../../configuration/cheatsheet.md#instance)) from the database, they will be refetched from source when accessed.
21 The disk space will only be reclaimed after `VACUUM FULL`
24 $PREFIX pleroma.database prune_objects [<options>]
28 - `--vacuum` - run `VACUUM FULL` after the objects are pruned
30 ## Create a conversation for all existing DMs
35 $PREFIX bump_all_conversations
38 ## Remove duplicated items from following and update followers count for all users
41 $PREFIX update_users_following_followers_counts
44 ## Fix the pre-existing "likes" collections for all objects
47 $PREFIX fix_likes_collections