Moving WSS 3.0 and MOSS 2007 content databases

One of the questions that my I usually encountered during conferences is whether we can move WSS 3.0 or MOSS 2007 content databases from one SQL Server to another. If you’ve ever wanted to relocate your WSS 3.0 or MOSS 2007 content databases from one SQL server to another, the steps are fairly simple.

Step 1: Detach the content database from the source SQL server and copy the .mdf and .ldf to the target SQL server.

Step 2: Attach the .mdf and .ldf files on the target SQL server as a new database.

Step 3: Run the following stsadm commands from the command line on your SharePoint server to complete the move:

stsadm –o deletecontentdb –url http://<yoursiteurl> –databasename <your_content_database> –databaseserver <your_source_SQL_server>

stsadm –o addcontentdb –url http://<yoursiteurl> –databasename <your_content_database> –databaseserver <your_target_SQL_server>

aspnet_compiler.exe exited with code 1 during build process

Recently, I encountered aspnet_compiler.exe exited with code 1 error during build process. For you information, I’m running the build in Team Foundation Build 2010. Surprising, I only hit this error during local build with Visual Studio 2010.  To trace the root cause of the problem, you need to run aspnet_compiler manually with the error stack. The following are the steps that I performed:

Step 1: Open the Visual Studio 2010 Command Prompt.

Step 2: Run the aspnet_compiler.exe with the errorstack flag on your project (where C:\PROJECT is the location of your project). For example,

<Command Prompt>aspnet_compiler.exe -errorstack -v /PROJECT -p C:\PROJECT

Step 3: Look for the problem in the output.

Step 4: Since it doesn’t give you a specific line number, search through your ASPX files and try to find the error..

Step 5: After fixing the problem, rerun the compiler to ensure the problem is solved.

Repairing SharePoint Web Applications

There are several things that can happen over the lifetime of a deployment that can cause the mappings between Team Foundation Server and SharePoint Products to get out of sync.

This can result in errors about permissions in Team Foundation Server contacting SharePoint Products and vice versa.  Another way this can show up is in a project site not knowing which team project it is hooked up to (even though the Portal Settings dialog is correct and has the “reports and dashboards” checkbox checked).

If you see things like this, you should first try to repair the connections.

Step 1: Open the Team Foundation Server Administration Console on the application tier machine.

Step 2: Go to the SharePoint Web Applications node.

Step 3: Select the web application in question.

Step 4: Select the Repair Connection action.

Step 5: Click the Repair button on the dialog.

Step 6: As steps occur, messages will be added to the text box.

Step 7: When its done, take note if you get any warnings as you might need to manually configure things (usually if you are not a Farm Administrator in SharePoint Products).

Step 8: Close the repair dialog and retry.

Verifying the Team Foundation Solutions have been deployed successfully

To verify whether the Team Foundation Solutions have been deployed successfully, perform the following steps:

Step 1: Use a web browser to open the Central Administration site (i.e. http://servername:17012 or http://serveripaddress:17012).

Step 2: Click on the Operations tab.

Step 3: Under the Global Configuration section, click Solution management.

Step 4: In Solution Management, verify the Status column of following Team Foundation is Deployed:

  • Microsoft.TeamFoundation.SharePoint.wsp should be deployed globally.
  • Microsoft.TeamFoundation.SharePoint.Dashboards.wsp should be deployed globally.
  • TSWAWebPartCollection.wsp should be deployed to all content web applications.

Configure Team Foundation Server 2005 Windows SharePoint Services 2.0 sites to use Team Foundation Server 2010 Windows SharePoint Services 3.0 site templates

In order to best take advantage of new Windows SharePoint Services 3.0 functionality after migrating your Windows SharePoint Services 2.0 content database to Windows SharePoint Services 3.0, you need to perform the following steps:

Step 1: Open the Windows SharePoint Services 3.0 team project portal you would like to upgrade. (e.g. http://tfs/sites/teamproject)

Step 2: Click Site Settings.

Step 3: On the Site Settings page, click Reset to site definition under the Look and Feel column.

Step 4: On the Reset Page to Site Definition Version page, you can choose to either reset an individual page within the site collection or to reset all of the pages within a site collection. Once you have made your decision, click Reset then click OK in the confirmation dialog. Note: I would recommend you to reset all of the pages within a site collection.

Step 5: On the Site Settings page, click Quick Launch under the Look and Feel column and add the following headings and links

  • Heading -> Process Guidance
    Process%20Guidance/ProcessGuidance.html
  • Heading -> Reports
    _layouts/tfsredirect.aspx?IsReport=0
  • Link -> Bug Rates
    _layouts/tfsredirect.aspx?IsReport=1&ReportName=Bug+Rates&ShowToolbar=1
  • Link -> Builds
    _layouts/tfsredirect.aspx?IsReport=1&ReportName=Builds&ShowToolbar=1
  • Link -> Quality Indicators
    _layouts/tfsredirect.aspx?IsReport=1&ReportName=Quality+Indicators&ShowToolbar=1
  • Link -> Project Velocity
    _layouts/tfsredirect.aspx?IsReport=1&ReportName=Project+Velocity&ShowToolbar=1
  • Link -> Issues List
    _layouts/tfsredirect.aspx?IsReport=1&ReportName=Issues+List&ShowToolbar=1
  • Link -> Exit Criteria Status
    _layouts/tfsredirect.aspx?IsReport=1&ReportName=Exit+Criteria&ShowToolbar=1

Upgrading Windows SharePoint Services 2.0 to Windows SharePoint Services 3.0

Recently, I did a trial upgrade of a Windows SharePoint Services 2.0 content database from a Windows SharePoint Services 2.0 instance to a Windows SharePoint Services 3.0 instance as part of migrating Team Foundation Server 2005 to Team Foundation Server 2010. I would like to share my personal experience in this blog entry.

Assumptions:

1. You have a Windows SharePoint Services 2.0 instance either as part of Team Foundation Server 2005 or Team Foundation Server 2008 on a server called ‘oldserver’. ‘oldserver’ is your migration source.
2. You have a Windows SharePoint Services 3.0 instance either as part of Team Foundation Server 2010 on a server called ‘newserver’. ‘newserver’ is your migration destination.

Steps to be performed on the ‘oldserver’

Step 1:

Download SharePoint Products and Technologies Utility: Upgrade Pre-scan Tool (http://www.microsoft.com/download/en/details.aspx?DisplayLang=en&id=22806).

Step 2:

At the command prompt, type:

prescan.exe /all

Step 3:

Use the SQL Server Management Studio to perform a full backup of the Windows SharePoint Services 2.0 content database.

Step 4:

Copy the Windows SharePoint Services 2.0 content database to the ‘newserver’.

Steps to be performed on the ‘newserver’

Step 1:

Use the SQL Server Management Studio to perform a restore of the Windows SharePoint Services 2.0 content database.

Step 2:

At the command prompt, type:

cd C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN

Step 3:

At the command prompt, type:

stsadm -o addcontentdb -url http://tfs -databasename STS_WBTFS_1 -databaseserver tfs

Step 4:

At the command prompt, type:

stsadm -o upgrade -inplace -url http://tfs

or altertivately,

stsadm -o upgrade -forceupgrade -inplace -url http://tfs

Configuration Steps to be performed on the ‘newserver’

To add a SharePoint site as a portal to an existing team project:

Step 1:

In Team Explorer, right-click the name of the project, point to Team Project Settings, and then click Portal Settings.

Step 2:

On the Project Portal tab, select the Enable project portal check box.

Step 3:

Click Use this SharePoint site, and then click Configure URL.

Step 4:

In the Web application list, click a SharePoint Web application.

Step 5:

In Relative site path, type the relative path of an existing SharePoint site. As you type the path, it appears at the end of the value in URL.

Step 6:

In URL, click the link, verify that the path is correct, and then click OK.

Step 7:

If you want this SharePoint site to show data for this project, select the Reports and dashboards refer to data for this team project check box.

To add a Web site as a portal to an existing team project:

Step 1:

In Team Explorer, right-click the name of the project, point to Team Project Settings, and then click Portal Settings.

Step 2:

On the Project Portal tab, select the Enable project portal check box.

Step 3:

Click Use a Web site, and then type the URL for the site that you want to use.

Step 4:

Click Check URL to verify that the Web site is valid. The Web site that you specified opens in a new window.

Step 5:

Click OK.

Hotfix for Team Foundation Server 2010 Service Pack 1 Cumulative Update 1 – KB2580221

Recently, when I used Microsoft Visual Studio Team Explorer 2008 to manage the security settings for a Team Foundation Server 2010 server, I encountered a System.NullReferenceException exception. Upfront, I thought this might be due to conflicting hotfixes. After several rounds of investigations, I discovered that this is a known issue and has been solved in Hotfix for Team Foundation Server 2010 Service Pack 1 Cumulative Update 1 – KB2580221.

The following issues are also solved as part of the hotfix:

1. When you connect to a Microsoft SQL Server Analysis Service database in Team Foundation Server 2010, you cannot process the SQL Server Analysis Service database if the following conditions are met:
a.  The database is located on an instance of SQL Server in a failover cluster.
b.  The instance of SQL Server does not use the default listening port.

2. You have two files in Team Foundation Server 2008. For example, you have file A and file B. The earlier name of file B is the same as the current name of file A. You edit the two files and then check in the two files in the same changeset by using the source control in Team Foundation Server 2008. You upgrade the server that is running Team Foundation Server 2008 to Team Foundation Server 2010. You edit file A, and then you check it in. A user tries to download the earlier version of file A by using Team Explorer. In this scenario, you receive the following error message:

The server returned content type text/html, which is not supported.

Download URL for Hotfix for Team Foundation Server 2010 Service Pack 1 Cumulative Update 1 – KB2580221: http://www.microsoft.com/download/en/details.aspx?id=26211