Je ne peux pas supprimer ou restaurer une collection de sites ou une base de données de réparation
-
10-12-2019 - |
Question
Lorsque j'essaie de faire une restauration d'une collection de sites,
restore-spsite -Identity https://xx/10014628/ -Path D:\SiteCollectionBackups\10014628.bak -Force -Confirm
Je reçois:
restore-spsite : <nativehr>0x80070003</nativehr><nativestack></nativestack>
At line:1 char:1
+ restore-spsite -Identity https://xx/sites/100146 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (Microsoft.Share...dletRestoreSite:SPCmdletRestoreSite) [Restore-SPSite], DirectoryNotFoun
dException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletRestoreSite
Erreur complète du journal
System.IO.DirectoryNotFoundException: <nativehr>0x80070003</nativehr><nativestack></nativestack>, StackTrace:
at Microsoft.SharePoint.SPWeb.InitWebPublic()
at Microsoft.SharePoint.SPWeb.get_ID()
at Microsoft.SharePoint.Administration.SPSiteCollection.Restore(String strSiteUrl, String strFilename, Boolean bOverwrite, Boolean bGradualDelete, Boolean hostHeaderAsSiteName, Boolean preserveSiteId)
at Microsoft.SharePoint.PowerShell.SPCmdletRestoreSite.InternalProcessRecord()
at Microsoft.SharePoint.PowerShell.SPCmdlet.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
at System.Management.Automation.CommandProcessorBase.DoExecute()
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.DlrScriptCommandProcessor.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
at System.Management.Automation.CommandProcessorBase.DoComplete()
at System.Management.Automation.Internal.PipelineProcessor.DoCompleteCore(CommandProcessorBase commandRequestingUpstreamCommandsToStop)
at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
at System.Management.Automation.Runspaces.LocalPipeline.InvokeHelper()
at System.Management.Automation.Runspaces.LocalPipeline.InvokeThreadProc()
at System.Management.Automation.Runspaces.PipelineThread.WorkerProc()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
si j'essaie de
remove-spsite -Identity https://xx/sites/10014628/ -Confirm -Force -Verbose
Je reçois la même erreur.
Si j'essaie:
stsadm -o databaserepair -url "https://xx" -databasename "ContentDatabases"
Donc, je ne peux pas supprimer cette collection de ce site, ni la réparer, ni la restaurer. Aucune idée ??
La solution
I recently ran into the exact same issue in SP 2013 where my Dev machine had the RTM install and the target server the June CU. We ended up copying the Content Database from SQL directly, reattaching and associating it to a Web Application and it worked flawlessly.
It seems the Restore command is no longer backwards compatible and can't be relied to restore betweem different patch levels (so to everyone out there, you better backup your SQL directly instead of having a Backup-SPSite routine) but this might have been an isolated issue.
Autres conseils
Seems that in the previous action, a site collection reference already has been created somewhere in the web application configuration. Although there’s a reference, the necessary files to render the page aren’t there. There’s also no possibility to remove the existence of the site collection. When you try to do something with the site collection, for example try to delete it, you always get the following exception:
System.IO.DirectoryNotFoundException, <nativehr>0x80070003</nativehr><nativestack></nativestack>
One solution is to remove the content database, and recreate the content database and site collection with PowerShell. Using the GUI will break things again.
If that doesn’t work, I found 2 other workarounds for the problem:
Delete the web application and recreate it. This is not a good solution, because you create downtime, lose managed paths, configuration, etc. When you encounter the error on the “Processing…” page, leave the window open to preserve your session. Fix the issue that shows up in the log, and simply hit F5 and use the same session. This will complete the creation process of the site collection and not throw any exception.
Also check whether the site collection is locked as read only.
Please have a look at the below URL too,
do this:
open powershell as admin (run as admin):
restore-spsite -Identity https://xx/10014628/ -Path D:\SiteCollectionBackups\10014628.bak -Force -Confirm
change the D drive to a local drive like C but dont put the file on root like so C:\10014628.bak
rather have it within a folder C:\SiteCollectionBackups\10014628.bak
should do the trick
also like to note and ask have you updated sharepoint 2013 recently? if so:
After installing the fixes you need to run the SharePoint 2013 Products Configuration Wizard on each machine in the farm.
otherwise it would bring about errors like what you got!
I am not sure if i am late or not.
this error comes for one of the following reasons:
Backup SharePoint server version is different than the restore server version
The backup file is corrupted
The used user account is not having the permission on the content DB for the web application that you want to restore on.
To get the site id use powershell. Interestingly in my case I can create the powershell object. E.g.
$s=Get-SpSite <url>
$s.ID
Go to C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN
Then execute
STSADM -o deleteconfigurationobject -id <site id>
In once case this worked
Or you can try deleting
$s.Delete
If everything fails, detach and reattach the content database.