VersionId NOT IN (SELECT versionId FROM cmsDocument WHERE updateDate > OR published = 1 OR newest = 1) AND TRUNCATE TABLE umbracolog - faster if log table is very big and you don't need anythingĭELETE FROM umbracolog WHERE Datestamp OR published = 1 OR newest = 1) ANDĬontentNodeId IN (SELECT DISTINCT nodeID FROM cmsDocument) Try this sql query: - Umbraco Clear Old Document Versions To Decrease Database Size And Improve PerformanceĭECLARE Datetime = DATEADD(m, -1, getdate()) UnVersion: automatically remove previous versionsįALM Housekeeping: can specify which previous versions to remove There's also a couple of useful packages: and which are not published and which are not the newestĭELETE FROM cmsPropertyData WHERE VersionId IN (SELECT id FROM #Versions)ĭELETE FROM cmsContentVersion WHERE VersionId IN (SELECT id FROM #Versions)ĭELETE FROM cmsDocument WHERE VersionId IN (SELECT id FROM #Versions) from the nodes which are published and which are not in the recycle bin DELETE all versions from cmsPropertyData, cmsContentVersion, cmsDocument and where published is set to false and newest is set to false Insert all versionId's from all nodeIds in the #Nodes table Create a temporary table for all versionId's to deleteĬREATE TABLE #Versions (id UniqueIdentifier) INNER JOIN cmsDocument D ON N.ID = D.NodeId Insert all nodeIds from all documents which are published and not in the recycle bin Delete all rows if the table exists before Create a temporary table for all documents which are published and not in the recycle bin ![]() ![]() Yes the log data in umbracoLog can be deleted, and it's also possible to remove previous version values from the cmsPropertyData table.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |