How to reduce OC_Activitiy table

Running with MySQL. After a couple of months, the database table oc_activity gets quite big, 3.3GB. Is there any way to reduce the size of this? or it will keep growing?

Add a line in /config/config.php:

'activity_expire_days' => 365,

365 is the default value. Set it to 90 or less.

https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#app-config-options

1 Like

Hello,

after i change value in config file “‘activity_expire_days’ => 100,” my file size is still big. I wait 15 hours but nothing change , is it anyway how to make some manual cleanup of this file? I have very low storage because of it.

du -hs /var/lib/mysql/nextcloud/* | sort -rh | head -1
11G /var/lib/mysql/nextcloud/oc_activity.ibd

free space in /var is now only 150MB …

My NC is old and have new on new server already running but before shutdown old one i need give users some days to migrate data. That’s why i need to fix this :frowning:

@sakal
have you figured out how to cleanup old records of oc_activity table?

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#activity-app

Set it to a lower number then wait 24 hours for the clean-up job to run.

1 Like