I was trying to shrink a DB and I found the umbracoAudit with 3GB of data.
Im permitted to clear the rollback versions. With some queries, the version seems clear from the Umbraco node but still, I found this table with a huge amount of data.
What's the purpose of the umbracoAudit table?
Is it used for keeping the login records?
Can we truncating that?
SELECT cv.id
INTO #toDelete
FROM umbracoDocumentVersion dv
INNER JOIN umbracoContentVersion cv ON dv.id = cv.id
WHERE cv.[current] != 1 AND dv.published != 1 AND cv.VersionDate < DATEADD(day, -1, GETDATE())
DELETE FROM umbracoPropertyData WHERE versionId IN (select id from #toDelete)
DELETE FROM umbracoDocumentVersion WHERE id IN (select id from #toDelete)
DELETE FROM umbracoContentVersion WHERE id IN (select id from #toDelete)
DROP TABLE #toDelete
But the mentioned table umbracoAudit remains untouched.
Now I have truncated that one and the site working without any issues.
Is there any suggestions that will be helpful to reduce the DB size further?
Can we truncate umbracoAudit table
Hi Team,
I was trying to shrink a DB and I found the
umbracoAudit
with 3GB of data. Im permitted to clear the rollback versions. With some queries, the version seems clear from the Umbraco node but still, I found this table with a huge amount of data.What's the purpose of the
umbracoAudit
table?Is it used for keeping the login records?
Can we truncating that?
Regards
Hi Arun,
The audit log table is used to show the history of a content item and maybe in other places as well.
I would suggest deleting records older than a certain date. For example only keep the ones from the last 6 months.
Dave
Thanks Dave,
I was able to clear the table
umbracolog
Also,
umbracoContentVersion
&umbracoDocumentVersion
But the mentioned table
umbracoAudit
remains untouched. Now I have truncated that one and the site working without any issues.Is there any suggestions that will be helpful to reduce the DB size further?
Thanks
Hi Arun,
Since 8.18 versions will be auto cleaned up in Umbraco. But if you are upgrading from a older version you will need to activate it : https://umbraco.com/blog/umbraco-818-release-candidate/?#history
For cleaning up the audit table you could write a scheduled task.
For V8 : https://our.umbraco.com/Documentation/Reference/Scheduling/
For V9+ : https://docs.umbraco.com/umbraco-cms/reference/scheduling
Dave
is working on a reply...