Showing posts with label Backup/Restore. Show all posts
Showing posts with label Backup/Restore. Show all posts

October 5, 2016

Error occurred while restoring site to new tenant - 0x80070003

While restoring site collection from one farm to another using power shell command: Restore-SPSite, I am getting below error.

Error: :-  <nativehr>0x80070003</nativehr><nativestack></nativestack>.Exception.GetType().FullName, <nativehr>0x80070003</nativehr><nativestack></nativestack>.Exception.Message

Below are few possible reasons you might get this error:

1) SharePoint Version differs: Version may be lower in destination farm than source farm environment. It can be verified by Go to Central Administration --> System Settings --> Manage Servers in the farm and check version.

https://1.bp.blogspot.com/-FlaoqNYuwLE/V-PO4baHDqI/AAAAAAAAAA0/xwX8Ky-Z6yUbU0x5pRdDv0MDKr7lGjNAwCLcB/s320/blog%2Bpics.png


Resolution: Version in destination farm i.e. where we restore site collection must be same as source. Upgrade the version by installing necessary Service packs or Cumulative Updates.

2) SQL Server Version differs: SQL Instance version may differ in destination farm where we are restoring site collection, from the source farm where we have taken site collection backup.

Resolution: Install correct version of SQL Server with service pack in destination farm.

https://1.bp.blogspot.com/-eIIx3-ENerY/V-PQwvoTXUI/AAAAAAAAAA8/MWGCwfxKMIwQsSKGaxYqrDKuRny02ek8QCLcB/s400/sql%2Bserv.png


3) Memory Insufficient: In my case, both SharePoint farm and SQL Server versions were same. So, I checked SQL Server Logs through ULS log viewer and came to know that there was insufficient memory to execute queries in content database.

Resolution: Connect SQL Server by SQL Server Management Studio --> Right click and go to properties and increase Maximum Server Memory according to need.

https://4.bp.blogspot.com/-NIevkb_TAoU/V-PTKJINEEI/AAAAAAAAABM/0J71V6PkhO8HZMk65-y6OhI56D5YBCQXgCLcB/s640/3.png\



https://1.bp.blogspot.com/-upouqCG_JcQ/V-PTKFhqD_I/AAAAAAAAABI/ZemcqDy6o-wbPHz3pvUq2skECKv2ijcwQCLcB/s640/4.png


 If you have any questions you can reach out our SharePoint Consulting team here.




June 13, 2013

Backup/Restore SPWeb programmatically

  • Backup SPWeb Many times we may require to backup SPWeb programmatically. This is the method that can be used to generate backup file of SPWeb. This will generate backup file with ".cmp" extensions and will be stored at specified location.

    //This will create backup file (ABC.cmp) of SPWeb "ABC".
    
    using (SPSite site = new SPSite("http://br76:42319/ABC"))
    
    {
    
    using (SPWeb web = site.OpenWeb())
    
    {
    
    string bPath = "C:\\Backup"; //Location where backup file is to be stored.
    
    SPExportObject exportSite = new SPExportObject();
    
    exportSite.Type = SPDeploymentObjectType.Web;
    
    exportSite.Url = web.Url;
    
    exportSite.IncludeDescendants = SPIncludeDescendants.All;
    
     
    
    SPExportSettings settings = new SPExportSettings();
    
    settings.AutoGenerateDataFileName = false;
    
    settings.BaseFileName = "ABC"; // Name of the backup file.
    
    settings.FileLocation = bPath;
    
    settings.SiteUrl = web.Site.Url;
    
     
    
    settings.ExportMethod = SPExportMethodType.ExportAll;
    
    settings.FileCompression = true;
    
    settings.IncludeSecurity = SPIncludeSecurity.All;
    
    settings.IncludeVersions = SPIncludeVersions.All;
    
    settings.ExcludeDependencies = false;
    
    settings.OverwriteExistingDataFile = true;
    
    settings.ExportObjects.Add(exportSite);
    
    settings.Validate();
    
    SPExport spExport = new SPExport(settings);
    
    spExport.Run();
    
    }
    
    }
  • Restore SPWeb
    This method can be used to restore SPWeb using the backup file of SPWeb.

    //This will create restore web "ABC" from backup file "ABC.cmp".
    
    using (SPSite site = new SPSite("http://br76:42319/ABC"))
    
    {
    
    using (SPWeb web = site.OpenWeb())
    
    {
    
    SPImportSettings settings = new SPImportSettings();
    
    settings.SiteUrl = web.Site.Url;
    
    settings.FileLocation = "C:\\Backup";//Location where backup file is located.
    
    settings.BaseFileName = "ABC.cmp";// Name of the backup file.
    
    settings.UpdateVersions = SPUpdateVersions.Overwrite;
    
    settings.RetainObjectIdentity = false;
    
     
    
    SPImport import = new SPImport(settings);
    
    import.Run();
    
    }
    
    } 

If you have any questions you can reach out our SharePoint Consulting team here.

November 6, 2009

Backup and Restore site in MOSS 2007

It happens to everyone that you need to move the same Microsoft Office SharePoint (MOSS) site to new location. At this time you can use the inbuild commands to backup the site from existing location and restore it to somewhere else.

MOSS has a powerfull command "stsadm" using that you can do it easily.

To use stsadm commands, open the command prompt and navigate to

c:\program files\common files\microsoft shared\web server extensions\12\bin


To Backup Site type the command

stsadm -o backup -url http://servername:portnumber/siteName -filename DestinationFolderPath/Backup Filename(c:\backupfilename)

This command will create a file to destination folder containing backup of the source site.

Once you have the backup file, that can be restored in MOSS by a single commands as below in sequence.
Steps to Restore Site
  • Create a web application and create a site with same site template using Central Administrator which you have backed up.
  • Type the command
stsadm -o restore -url http://servername:portnumber/siteName -filename backupfilepath(c:/backupfilename) -overwrite

This will restore the site to your defined location.

"Make sure you have full rights on the content database to take backup or restore site"

If you have any questions you can reach out our SharePoint Consulting team here.
By: Piyush