Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I hope someone can help me solve this weird problem I'm facing for 4 days.

I'm trying to restore the backup of Sharepoint 2010 web application. I'm using Windows Powershell command :

Restore-SPSite -identity http://servername:7070 - path D:\moss7070\moss7070.bak -force. 

I've created an empty web application before I run the command. The command runs for around one hour to two hours before it shows this error:

Restore-SPSite : The site collection could not be restored. If this problem persists, please make sure the content databases are available and have sufficient free space.
At line:1 char:15 + restore-spsite <<<< -identity -path <.bak> -verbose -force + CategoryInfo : InvalidData: (Microsoft.Share...dletRestoreSite:SPCmdletRestoreSite) [Restore-SPSite], SPException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRestoreSite

The bak file is around 37 GB and I have 1.6 TERABYTE free space on the disk drive. I'm using SQL SERVER 2008 R2 Evaluation Version (full, not the express version). Database & SharePoint Users have full administration permissions.

What am I doing wrong?!

share|improve this question
    
some additional questions: Is SQL Server running on the same machine? How much diskspace is left on the disk that stores the sql databases? Is that 1.6 terabyte free disk space just on your d:\? –  Bas Lijten Jul 31 '11 at 10:06
    
Yes, the SQL Server runs on the same machine. It's a development server with Windows 2008 R2 Enterprise. The 1.6 terabyte free disk space is on drive C:\ where Windows, SharePoint and SQL Server are installed. D:\ is a second 8 terabyte partition. –  Ahmed Jabar Jul 31 '11 at 11:25
    
Its a powershell command. Its a powershell which is not exactly same as SPDatabase you referred to. I dont get any error while running this PS script. –  user11466 Oct 19 '12 at 6:30

4 Answers 4

Don't be fooled by the "have sufficient free space" message...I think that's just part of a higher level generic error message.

I had this same exact error about a month ago and the only way I was able to get around it was going into Central Admin, create a new content database on the web app, and then use the databasename argument on the Restore-SPSite command.

Restore-SPSite -identity http://servername:7070 - path D:\moss7070\moss7070.bak -databasename NewContentDbName

I'd also drop the -force argument...you shouldn't need it if your're restoring to a blank web app without any existing site collections.

share|improve this answer
    
I tried that but no success. I also tried creating a blank Content Database from central admin but same error appears. I haven't tried it without "Force" parameter though. but here's something I noticed today, when I check the Database while the command is running, I can see that the tables are being populated with correct content, but once that error appears, all content is deleted! Why? The biggest hassle is waiting for at least two hours every time I try to test something. –  Ahmed Jabar Jul 31 '11 at 14:27
    
I assume it deletes everything as part of a rollback of the restore operation. Maybe try setting the contentdb size to somewhere around 50gb and the log to 10gb...maybe it's struggling with dynamic growth. –  Rob D'Oria Jul 31 '11 at 14:51
    
Along with that set the recovery mode on the db to Simple while it's restoring: msdn.microsoft.com/en-us/library/ms189272.aspx –  Rob D'Oria Jul 31 '11 at 14:53
    
Hi Rob, I tried setting the initial db size to 100 GB and log file to 15GB but the same error message appeared. I referred back to the source db where I got the backup and its size is only 80GB, so 100GB should be sufficient. I can simply do an SQL backup of the content DB and restore it in the development server, but I want to keep that as a last resort. I badly need to know why the normal backup is not working. –  Ahmed Jabar Aug 1 '11 at 10:48
    
Thanks Rob for your post, I've been facing this issue for 3 days and tried everything else under the sun. Creating a new DB let me restore the site collection. Thanks a Tonn! Ashish. –  user9928 Aug 7 '12 at 14:23

I got this error restoring to my VM. The quote from the reference below worked too, but for my environment since its a dev, i just deleted the web app, recreated the site collections and ran my restore-spsite command with force and verbose options and it worked fine.

"I had previously deleted the site collection using Central Administration, and in this case I was trying to copy the site collection between virtual machines.

Deleting the site collection in Central Administration used the gradual delete method which left the site collection GUIDs behind in the content database, which caused the restore to fail.

To resolve this I manually ran the Gradual Site Delete timerjob, after this finished I was then able to restore the site collection normally."

Reference

share|improve this answer
up vote 0 down vote accepted

The problem was ridiculous. Apparently the backup file had some unknown issue. I can't figure it out but maybe the backup process was wrong. I tried restoring a different site collection that has larger size than the old one and it worked fine. The restore tool was showing the wrong error. Rob was right when he said the error could be pointing to something else.

So always make sure you have enough free disk space and make sure the backup file is clean.

share|improve this answer

All you need to do is to just run these commands:

1) This will delete all site collections one by one from Sharepoint Recycle bin

Get-SPDeletedSite -webapplication "http://RootSiteCollection" | Remove-SPDeletedSite.

This will prompt you before deleting each site collection from sharepont recycle bin

2) This will remove the orphaned enteries from content database

Open Sharepoint management Powershell and run this

$db = Get-SPDatabase "Content_DB_Name";

$db.Repair($true);

$db.Update(); 

Cheers,

Manvir

share|improve this answer
    
This does not answer the question. Also SPDatabase.Repair() does not exist as a function. msdn.microsoft.com/en-us/library/… –  RJ Cuthbertson Oct 12 '12 at 2:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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