Skip to main content

SharePoint Backup and Restore

If  you are moving your site from Testing(Staging) to Production, site backup and restore (using STSADM command line tool)  is the way to go. Other ways include SQL Server, Sharepoint Designer, DPM etc. However, site backup and restore using STSADM is probably the easiest and fastest one.


Backup the site using the following STSADM Command:Stsadm –o backup –url http://<server name>:<port> -filename <path\name to be used for the backup file>
Example:
Stsadm –o backup –url http://pravahaminfo:4545–filename "e:\backup4545.bak"

After the backup has been completed, “Operation Completed Successfully” message should be displayed.



Create a new Web Application for restoring the site:Go to Central Administration -> Application Management -> under SharePoint Web Application Management -> click Create or Extend Web Application. Fill in the required information, click Ok and wait until the progress continues.
Once the new web application is created, run the following STSADM command and restore the site using the backup file created above.

Stsadm –o restore –url http://<server>:<port> -filename <path\name of the backup file>
Stsadm –o restore –url  http://pravahaminfo:5454  –filename "e:\backup4545.bak"

Restored site should be up and running.
If it is not (and you are receiving weird errors in your browser), keep reading:
Now it could be the case that you have customized your site. So, we must deploy those customizations properly for the site to work as expected. This is typically a scenario while moving your site from Testing to Production environment. First you have to add the solutions (if any created) to the farm.
Add a Solution to the SharePoint Farm:Add the solution package to the farm by running the following commands. Make sure full path of WSP file is supplied.
 
stsadm –o addsolution –filename <path to mysolution.internet.test.wsp>

Deploy the Solution to the restored site:
Now we need to deploy the newly added solution to our restored site. Click the solution name and select ‘Deploy’ button from top. Select the appropriate web application in the deployment settings and click OK. This will take several minutes to deploy mysolution.internet.test.wspresources (list templates, features, assemblies, master pages, styles). Once the solution has been deployed, reset IIS to ensure all deployed changes are picked up by the web application.
You can also deploy the solution from the command line with the following SharePoint admin command.

stsadm -o deploysolution -name mysolution.internet.test.wsp -url <site> -immediate -allowgacdeployment –allowcaspolicies

Make sure all your assemblies (DLLs) are available in Global Assembly Cache (GAC) usually placed at c:\windows\assembly.  
 Activate features installed by mysolution.internet.test.wsp solution package:Go to the newly restored site, click Site Actions, click Site Settings, click Site Collection Features. Click Activate button to activate any Site Collection Feature.
Go to the newly restored site, click Site Actions, Site Settings, Site Features.
Click Activate button to activate any Site Features.
Update Web.Config file:It will be usually a case that your solution package will deploy a few DLLs with it. So we need to add all those Safe Control entries, Assembly Bindings, Keys and any other web.config changes to our newly restored sites’s web.config. Weird browser errors that I mentioned above usually appear due to these missing entries in web.config, specially when you are restoring on the same machine/server…….As assemblies will already be there in the GAC if the restore operation was performed on the same machine….you just need to make web.config entries to the restored site…..adding and deploying of the solution could be skipped. So lets do the copy paste operation from the old web.config to the new web.config. Just compare the two web configs and copy/paste the missing entries into the new. 
Web.config file could be found at the following path:
<drive letter>:\Inetpub\wwwroot\wss\VirtualDirectories\<port number>\web.config
 

Example:C:\Inetpub\wwwroot\wss\VirtualDirectories\5454\web.config 
 

Usually these changes will include Safe Controls, AssemblyBindings, PageParserPaths and Keys etc. After making these changes your site should be ready in Production.
If you are worried about the bad habit of Moss saving absolute URLs for the page layout in the properties of a publishing page, then relax, solution is already in the market:
References:
you are refering to the following Microsoft article that says that moving a farm using STSADM is obsolete:
and from here they will point you to “Moving to Another Farm” using SQL Server Tools:
Before I say why I was able to use STSADM, I will take this opportunity to share some important info:
You can use STSADM command to backup and restore on the same farm:
and you should not use STSADM command to restore to another farm, that’s right.
To restore to another farm, you must use SQL Server tools:
http://technet.microsoft.com/en-us/library/cc261918.aspx


and here is the important information: the specs of the farm on which you are restoring should still be exactly the same as the one from which backup is taken from. Specs means server names, software updates, number of servers…
Now if you are restoring to another farm which has different specs, then it will not be called as MOVING to another farm, it will be either MIGRATING or UPGRADING to anohter farm…..good news is that its still doable:
So, what have I done above in the post?
I haven’t actually moved the farm at all. I have simply moved a Site Collection from one farm to another.
So, the trick here is that moving farms is complicated……largely due to config and central admin databases because they contain computer specific information (in short)…….so why dont we simply move our site collection and probably relax :) :
You can also move individual content databases using STSADM:
Site Collection backup/restore that we did above will actually backup and restore the content DB.

I’m getting confused by all the options and different opinions in blogs. I’m going to move one or more site collections from one farm to a completely different one (new server names but same domain).
If I understand the link below correctly, Stefan Gossner basically says that in that kind of scenario the “Best is to use SQL backup/restore.”
If it’s a publishing site, one only needs to be sure to have SP2 and the April CU installed (so that links to pagelayouts are fixed), and then there are no problems using SQL backup/restore.



Comments

  1. Backup - restore - Upgrade
    This is full article about Backup - restore - Upgrade - step by step with image. nice to share my knowledge with anybody.

    ReplyDelete

  2. Hi there, awesome site. I thought the topics you posted on were very interesting.
    Sharepoint Backup

    ReplyDelete

Post a Comment

Popular posts from this blog

Tab Control in Asp.Net

Scenerio: I need your help in designing tab control in   asp.net .My requirement is I need a tab control in   asp.net (C#) like  for example goto my computer ,right click c drive and select properties.we get tabs like general,security etc....... like that i need to design one tab control(no need of any rightclick) in my web page and the database table columns should come as tabs and inseide the tab data of that particular column should come.   Example:Employee master tab1:Employee name.........his name in the tab tab2:Age.............his age tab3:Address........his address   Solution:   You can do this using a simple div <style type="text/css"> .tabs         {             position: relative;             height: 20px;             margin: 0;   ...

AI and Microsoft: Revolutionizing Efficiency in Nonprofit Organizations

  How AI and Microsoft Enhance Efficiency in Nonprofit Organizations In today’s fast-paced world, nonprofit organizations face unique challenges—limited resources, increasing demands, and the constant need to do more with less. But what if technology could be the game-changer they need? In my latest research paper,  "How AI and Microsoft Enhance Efficiency in Nonprofit Organizations" , I explore how cutting-edge technologies like Artificial Intelligence (AI) and Microsoft’s innovative tools are revolutionizing the way nonprofits operate. From streamlining administrative tasks to enhancing donor engagement and optimizing resource allocation, AI and Microsoft’s solutions are empowering nonprofits to focus on what truly matters—their mission. This paper dives deep into real-world examples, practical applications, and the transformative potential of these technologies. Whether you’re a nonprofit professional, a tech enthusiast, or simply curious about the intersection of technolo...

Social tagging overview in Sharepoint 2010

A tag is a word or phrase that identifies an individual piece of information according to a set of attributes or criteria. Tags make it easy to find and share information about a specific subject or task. Social tagging helps users categorize information in ways that are meaningful to them. Social tagging can improve the quality of search results by filtering against specific tags, and it can also connect individuals who want to share information with other users who have like interests. This article describes the social tagging features in Microsoft SharePoint Server 2010. This article does not describe how to configure social tagging features. It also does not discuss how to implement social tagging features as part of an overall social media strategy for an enterprise. About using social tagging features Social tagging features help users to share information and to retrieve relevant, high-quality content more efficiently. Such sharing encourages collaboration and b...