Recycle Bin still not removing files SharePoint 2010
We ran into an issue as we had a site collection that we wanted to save off as a template for creating new site collections. The problem was all the documents were still there and the backup file was 20 GB large.
The first thing to do was create a backup and then restore it to a new site collection. After that, we deleted all the documents. Next, we cleared out the recycle bin. Then we cleared out the site collection recycle bin. The backup of this site collection was still the same size (20 GB).
Next, I ran a script to list all the files. I found that the deleted files were still there. Here's that script:
The first thing to do was create a backup and then restore it to a new site collection. After that, we deleted all the documents. Next, we cleared out the recycle bin. Then we cleared out the site collection recycle bin. The backup of this site collection was still the same size (20 GB).
Next, I ran a script to list all the files. I found that the deleted files were still there. Here's that script:
select type, dirname, LeafName, size, TimeLastModified FROM [WSS_Content_Delete].[dbo].[AllDocs]
where (TimeLastModified < '2013-01-02') AND (Size is NOT NULL) AND (LeafName not like '%.aspx') and (DirName not like '%_catalog%') and (DirName not like '%Style Library%')
and (DirName not like '%_themes%')
and (Size <> 0)
and (DirName not like '%SiteCollection%')
and (DirName not like '%Reporting Template%')
and (DirName not like '%_cts%')
and (DirName not like '%/forms')
and (DirName not like '%/styles%')
order by TimeLastModified asc
where (TimeLastModified < '2013-01-02') AND (Size is NOT NULL) AND (LeafName not like '%.aspx') and (DirName not like '%_catalog%') and (DirName not like '%Style Library%')
and (DirName not like '%_themes%')
and (Size <> 0)
and (DirName not like '%SiteCollection%')
and (DirName not like '%Reporting Template%')
and (DirName not like '%_cts%')
and (DirName not like '%/forms')
and (DirName not like '%/styles%')
order by TimeLastModified asc
SELECT COUNT(*)
AS NUMBER_OF_ITEMS
FROM [WSS_Content_Delete].[dbo].[AllDocs]
where (TimeLastModified < '2013-01-02') AND (Size is NOT NULL)
AND (LeafName not like '%.aspx')
and (DirName not like '%_catalog%')
and (DirName not like '%Style Library%')
and (DirName not like '%_themes%')
and (Size <> 0)
and (DirName not like '%SiteCollection%')
and (DirName not like '%Reporting Template%')
and (DirName not like '%_cts%')
and (DirName not like '%/forms')
and (DirName not like '%/styles%')
AS NUMBER_OF_ITEMS
FROM [WSS_Content_Delete].[dbo].[AllDocs]
where (TimeLastModified < '2013-01-02') AND (Size is NOT NULL)
AND (LeafName not like '%.aspx')
and (DirName not like '%_catalog%')
and (DirName not like '%Style Library%')
and (DirName not like '%_themes%')
and (Size <> 0)
and (DirName not like '%SiteCollection%')
and (DirName not like '%Reporting Template%')
and (DirName not like '%_cts%')
and (DirName not like '%/forms')
and (DirName not like '%/styles%')
The next step was in Central Admin - manage web applications, general settings:
As you see, there is a "second stage recycle bin" and a default setting of 30 days to wait and delete recycle bin. Turning the second stage off and the 30 days down to 1 was what it took to finally purge those files from the database.
Comments
Post a Comment