0

I used the following script to backup/restore site collections

Backup-SPSite -Identity "http://domain" -Path "C:\backup\domain.bak" -Force -NoSiteLock

then I run this command to restore to another domain

Restore-SPSite http://anotherdomain -Path C:\backup\domain.bak -DatabaseName "domain_db " -HostHeaderWebApplication http://appurl -Force -DatabaseServer db_server_domain

Site that I backed up was around 700MB. It had some hundreds of photos. I restored the backup file to another domain and deleted all those folders under Photo Galleries (and also emptied all recycle bins). But when I create a backup file for second domain (which should not contain deleted photos) it's 700MB again. I check the folders using Design Manager and I don't see files there. Folders are empty.

Content database is also 900MB (database has only one site collection)

Why I get 700MB backup file for a site that is completely empty?

1 Answer 1

0

What's even more likely is that the size of the backup grows because of Audit logs. Audit logs increase the site collection's (=backup's) size but are not on shown in these records. Audit logs can be managed at http://sharepoint/_layouts/15/AuditSettings.aspx and viewed at http://sharepoint/_layouts/15/Reporting.aspx?Category=Auditing

If you wish to decrease the size of Audit log data, I'd recommend to trim the data. Instead of deactivating the audit logging (which, after all, was activated for a reason and one day can save you from a trouble or two) you could trim the log files to let's say until yesterday.

Here's a PowerShell-script which does the job:

$site = Get-SPSite -Identity http://sharepoint
#To Get Yesterday
$date = Get-Date
$date = $date.AddDays(-1)
#Delete Audit logs
$site.Audit.DeleteEntries($date)

Monitor the content DB's size before and after the trimming.

To avoid the continuous growing of Audit log, make sure you have a reasonable number of days at your site collection's Audit logging settings at specify the number of days of audit log data to retain. This could be e.g. 30, 60 or 90 days.

Ref: why backup-spsite get a backup much larger than $site.usage.Storage

3
  • Unfortunately this didn't work. $site.usage.Storage shows only 30MB but backup file is still same size 700MB. On my system each database has only a single site collection. And this particular database is 900MB.
    – Ergec
    Dec 2, 2016 at 10:18
  • have you checked SharePoint content log(Transaction Log Files) in SQL Server Management Studio. file size may be big. if yes then you need to shrink it. microtechpoint.com/index.php?route=blog/… Dec 2, 2016 at 10:43
  • checked database in MSSQL, Data size is 900MB log size is only 50MB. Problem is data. There must not be that much data.
    – Ergec
    Dec 2, 2016 at 10:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.