Home > MOSS, MS SharePoint Sever > How to move sharepoint sites from testing environment to production environment?

How to move sharepoint sites from testing environment to production environment?

Updated (19/04/2009):
Use backup and restore! Click here to view the post how to backup and restore your site from testing to production.

—————–
The major problem will be faced by the sharepoint developers/administrators starts when they complete the customization and move all their work to the production environment. The approach what we take for ASP.NET applications will not work out for sharepoint sites because all the page contents and configurations are stored in the database. So every developer will be thinking that there needs to be deployment project like MSI to easily deploy the sharepoint sites in the different machine other than the machine/server where we have developed. Microsoft has provided a command line tool to migrate all your works to another machine which is called as SMIGRATE.exe. This tool is available in your server (Which you have installed SPS and WSS) under the path
Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\Bin

either in c drive are d drive (Where you have installed the SPS and WSS). You can use this tool to backup and restore. To use this tool you must be a site administrator for both the web site being backed up and restored. You can see the switches of this utility by typing smigrate -h in your command line provided the exe path is included in your path list otherwise navigate to directory where you are having the exe file and run the command.Note: It will restore all your work which you have done using front page extension and sharepint admin pages. It will not move all you virtual server excluded path files. You should move the files manually to the destination virtual server Eg: you have used User controls to build the webparts and images. You have to place those .ascx and image files to the excluded folder. For that you need manually create the same folder structure in the destination virtual server path and move all the files from your source virtual server to here.Important: It is not like backup and restore like database. You can not restore a site on top of the existing web site which are templates applied already. It means when ever you are creating a site or sub site in the sharepoint server it will ask to choose the template at the final stage of site creation procedure. If you want to restore a site you have stop the site creation procedure at that point and restore your site from the backup.Procedure to Backup and restore Sharepoint sites:

Backup:
1. Make a note of all the excluded directories which are available in your source virtual server.
2. Navigate to
 
c:\program files\common files\Microsoft shared\web server extensions\60\Bin

(with assumption you have sharepoint installed on c drive) in your command prompt.
3. Run the command
 
smigrate -w http://Sites/ -f “d:\Backup.fwp” -u \ -pw

4. Now you can have a backup of your site at the specified location

Restore:
1. Create a folder in your sharepoint server Eg: C:\Restore
2. Open your IIS and create a new web site and map it to C:\Restore
3. Open the sharepoint central administration.
4. Create a portal site by mapping the exiting virtual server created at step 2
5. Step 4 will take some time to create a portal site. After successful creation of the portal site, Open the portal site home page and select the Sites link
6. Create a new site using Create site option in the left side of the page.
7. Note down the URL of your new site. (Eg: http://Sites/
8. Stop the progress and close the browser when the select template page comes.
9. Use smigrate -r -w < -f “d:\Backup.fwp” -u \ -pw
10. Copy your source web.config from your source virtual server and replace the web.config in your destination virtual server path (This is needed if you have done any change on the source web.config)
11. Copy all your excluded folders from your source virtual server to destination.
12. Browse the center Administration->Sharepoint Portal server->Configure virtual server settings from the Virtual Server List page->(Select the Virtual server)->Define managed paths to exclude the directories.Now you have a new site with the replica of the existing one.

At this stage you will have question in your mind what is the procedure if any page are list has been created after deployed into production. All pages you can copy and paste it in the destination server using MS FrontPage 2003

Advertisements
  1. Kevin
    April 2, 2008 at 4:07 pm

    Does this relate to Sharepoint Server 2007?

    Or is this for sharepoint 2003?

  2. laura
    April 22, 2008 at 11:44 am

    Does it matter if the virtual server is running on windows server 2003 x32, and the physical server, to which we are migrating to, is running on windows server 2003 x64?

  3. Mike
    June 3, 2008 at 4:59 pm

    how does it differ from using stsadm command line tool? I keep getting this error when trying to restore from virtual test lab server to production and it seems that orphaned items is the cause:

    Exception from HRESULT: 0x80040E2F

  4. May 24, 2009 at 10:12 am

    what about the automatic update of the standby server? Can i use batch files to backup production server and restore the backup files in the standby servers?

  5. courtney
    November 5, 2009 at 4:00 pm

    this seems to apply to SP 2003. If I replace smigrate with stsadm, will it work the same?

  6. January 6, 2010 at 4:15 am

    Currently I am doing a backup and restore site on SharePoint Portal server 2003. There is the production Server A which runs the portal website and the database for this is stored in Server B. I have installed the SQL Server 2000 and SharePoint 2003 on server C and want to restore the database and SharePoint to this server. After I do the restore of databases to server C, I restore the sharePOint website using Restore a Portal option from central administration. Once the portal is restored I copy and paste the Inetpub folder and the 60 folder from the production server (Server A) to Server C. When I try to access the website from server C, it gives me the error “You are not authorized to view this page”. I have checked my credentials and roles, but all seems to be fine. Please help me in this regards.
    Thank you,

  7. January 7, 2010 at 1:31 pm

    Thanks Rehman for your help,
    After Copying the external layout files present in the \60 folder, I also pasted the INETpub folder from the production server A to the Server C. When I try to access the site it gives me the error : Access to “RegisterAssembliesHeader.aspx” was denied. I have checked the user profiles and credentials. All seems to be fine.
    What could be the problem.
    Thanks in advance

  8. Moazzam
    August 3, 2011 at 5:41 am

    what about if i want to backup from following and to following:

    FROM: Sharepoint 2010 Server
    Server Server1.abcdomain.com
    SITE: http://testdev:33440

    TO: Sharepoint 2010 Server
    Server Server2.xyzdomain.com
    SITE: http://abc:63660

    So my question is can i import a full site from one sharepoint server to another when different AD, Sharepoint, URL and Ports are involved

    Thank you.

  9. Moazzam
    August 3, 2011 at 6:35 am

    hi Rehman, yeah sharepoint version is same. but how to export a complete site for example http://abc:3000 working at port 3000 and import in a different sharepoint so that site can work. Do i need to create the same site name in a new sharepoint, or just import the exported site. but it dosent asks for where to import to?

  10. August 3, 2011 at 7:01 am

    this should work for you:

    Backup:

    go to command prompt:

    stsadm -o backup -url http://abc:3000 -filename c:\mybackup.bak

    restore:

    stsadm -o restore -url http://def:5000 -filename c:\mybackup.bak

    http://def:5000 could be a blank web app without any site collections in it. If it has any site collection, use -overwrite parameter with the “restore” command above………this will delete the existing site collection and create a new one using the backup file.

  11. Moazzam
    August 3, 2011 at 7:02 am

    Hi Rehman , just worked it with following:

    Source Server

    CA > Backup and Restore > Perform a site collection backup

    This will result in a (.bak) file.

    Destination Server

    Create a web application (any url/port) random

    Create new site collection

    Restore the .bak file using Powershell command

    Restore-SPSite http://yoururl:port -Path -Force

    Done.

    Credit goes to SID.

  12. sudheer
    August 12, 2011 at 7:45 am

    Hi Rehman!

    Nice Post.
    i have configured content sources and scopes and edited some managed properties related to the content source in SP2010 Central Administration. Now, I would like to know how can i migrate all these to production environment?

    Regards,
    Sudheer.

  13. Mohammed Younus
    December 27, 2011 at 12:57 pm

    What is the procedure to Backup & restore the Site in SP2003.

  14. July 28, 2012 at 11:00 pm

    Hello are using WordPress for your site platform? I’m new to the blog world but I’m trying to get started and
    set up my own. Do you require any html coding expertise to make your own blog?

    Any help would be greatly appreciated!

    • July 30, 2012 at 2:04 am

      yes I use wordpress. It is free and no html coding needed unless you wish to i.e. the capability to use html is there but not needed.

      You can start a blog very easily.

  15. Habeeb
    May 19, 2013 at 8:22 am

    I am facing a problem after creating a site from site template. In the new site, controls are not coming up, instead I am getting error messages. web part / control not available.
    What to do to resolve this problem.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: