Mario VavtiMario Vavti wrote the following post Sat, 05 Dec 2026 20:39:56 +0100
Hubzilla 12 has delivered two new maintenance scripts. util/cleanup_dead_sites and util/cleanup_deleted_hublocs. The name of the scripts pretty much explains it all but there are some hidden gems though.

-----BEGIN ENCRYPTED MESSAGE-----
eyJoaW50IjoiNTQ2ODY1MjA2NTc4NjE2Mzc0MjA3NjY1NzI3MzY5NmY2ZTIwNzQ2MTY3MjA2ZjY
2MjA3NDY4NjUyMDZjNjE3Mzc0MjA3MjY1NmM2NTYxNzM2NSIsImFsZyI6IlhTYWxzYTIwIiwic2
FsdCI6Ijk4MTA0NTMyY2NmZDMxNzNmMjM3ZjAwMWQ0MDdkNTljZGE5ZjBiZDk0ZDU1ZmI1YzE5O
WZhZmFmZTYzN2FhOTEiLCJub25jZSI6ImQ4OWExMDU0M2JjYjg3NTVlYmIxZTlkZWM1OGQ1MDE3
Y2Y2MTkxODI1MzE2YjljNSIsImNpcGhlcnRleHQiOiIwYjIwYzg3M2JmZjBhN2U5MmY3ZTVjOGY
4MTBkYjE5M2M3NjJmOTUzM2FlNGVmNDA3YmQxNzVlNGVlNGNlNWNlODRkOTk0OGM1ODIxNDExNW
ZiNGQzZWY2MDEyMGYwMWZlODNjZGI4MmUwMjZlZDNhY2E2ZWI5MzE0NiJ9
-----END ENCRYPTED MESSAGE-----

Cleaning up dead sites:
util/cleanup_dead_sites will do a dry run only
util/cleanup_dead_sites delete will actually delete stuff from your DB
util/cleanup_dead_sites delete 1000 will slate 1000 sites for cleanup (default is 100)

Cleaning up deleted hublocs:
util/cleanup_deleted_hublocs will do a dry run only
util/cleanup_deleted_hublocs delete will actually delete stuff from your DB
util/cleanup_deleted_hublocs delete 1000 will slate 1000 hublocs for cleanup (default is 100)

If you have an old site you will need to run the script many times until all items will be cleaned up. Make sure to not slate too many sites/hublocs in one go to not overstrain your server.

Good luck!