Thursday, January 25, 2007

Moving SharePoint Portal Server 2003 Service Pack 2(SPS-SP2) and Windows SharePoint Services Service Pack 2 (WSS-SP2) to a new server and url.

Moving SharePoint Portal Server 2003 Service Pack 2(SPS-SP2) and Windows SharePoint Services Service Pack 2 (WSS-SP2) to a new server and url. The document describes how to move SharePoint Portal Server 2003 Service Pack 2(SPS-SP2) and Windows SharePoint Services Service Pack 2 (WSS-SP2) to a new server and url. The assumption is that both servers are already running SharePoint Portal Server 2003 Service Pack 2(SPS-SP2) and Windows SharePoint Services Service Pack 2 (WSS-SP2). The only real difference between the servers is that old server is running SQL 2000 and new server is running SQL 2005. BTW, SQL 2005 requires that Service Pack 2 be used. This is supported by Microsoft, but SQL 2005 and SPS without SP2 is NOT supported! IMPORTANT: This procedure requires down time where SharePoint will not be accessible to users! Stop your SharePoint website and App Pool, you don't need it unless procedure fails, and you need to rollback. Create a new website that uses the same host header as the SharePoint site. Create a index.htm file on that site that has javascript that will let user know the site has moved, they need to update bookmarks, and redirects them to new site. In IIS point all (or at least 404) http errors to this file. Now when users access the SharePoint site no url will be found, but they will be redirected to new server. Here is an example of what I used: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML><HEAD><TITLE>Please update your bookmarks</TITLE> <META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252"> <STYLE type="text/css"> BODY { font: 8pt/12pt verdana } H1 { font: 13pt/15pt verdana } H2 { font: 8pt/12pt verdana } A:link { color: red } A:visited { color: maroon } </STYLE> </HEAD><BODY> <TABLE width=500 border=0 cellspacing=10><TR><TD> <h1>Please update your bookmarks</h1> SharePoint has moved to a new url. <BR> The old url will no longer be valid. <BR> You will be redirected to the new site. Please update your bookmarks. </TD></TR></TABLE> <script language="JavaScript"> var oldUrl = window.location.href; var newUrl = oldUrl.replace("www.oldsite.com", "www.newsite.com"); alert("SharePoint has moved to a new url. \r\nThe old url will no longer be valid.\r\nYou will be redirected to the new site after you click OK. Please update your bookmarks."); window.location = newUrl; </script> </BODY></HTML> Stop this web site until you have the new server up, otherwise the users will be redirected to a non-existant site or at least start accessing it before it is verified. Backup Up Existing installation using Start Menu | All Programs | SharePoint Portal Server | SharePoint Portal Server Data Backup and Restore. Copy files to new server. Restore files using Start Menu | All Programs | SharePoint Portal Server | SharePoint Portal Server Data Backup and Restore. Change paths to new url here. IMPORTANT: Make sure your machine keys are the same on old and new server. c:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\LAYOUTS\web.config SharePoint web root\web.config You may need to create a new web site yourself. Be sure to restrict IP address so that only localhost can access it. Otherwise anyone who has the url can access it thinking it is ready to use, when it is not. At this point both SPS and WSS should be work fine. There is one thing that doesn't get restored correctly. That is the site directory in SPS. To update that execute the following. See justgeeks.blogspot.com and search for those stored procedure names. Create stored procs in _SERV and _SITE databases. After you execute the lines below no changes are made. This is really just to show what the changes will be. To actually execute the changes comment uncomment the SearchAndReplaceAllTables lines. These will do a replace all in database. use ITOPS1_SERV go SearchAllTables 'pww-nait.sjo.sc.philips.com' -- SearchAndReplaceAllTables 'www.oldurl.com', 'www.newurl.com' go use ITOPS1_SITE -- real changes go SearchAllTables 'pww-nait.sjo.sc.philips.com' -- SearchAndReplaceAllTables 'www.oldurl.com', 'www.newurl.com' go That should be it. Verify installation. Remove IP restrictions on new and old websites. Retire old server, or use it for backup server in case your current one fails. It is configured with SharePoint after all. Here is how long it took me to do this procedure: Back Up 2GB SharePoint installation: 8 minutes Copy to new server: 5 minutes Restore Database: 10 minutes Verify installation: 20 minutes

No comments: