Monday, February 13, 2012

Can not activate Sharepoint Server Publishing

I recently upgraded from SP2007 to SP2010 thru DB attached.  I noticed one of my site collection's Sharepoint Server Publishing Infrastructure and Sharepoint Server Publishing were not activated. I went ahead and activate the infrastructure on the site collection but when I try to activate the publishing on the site level it failed. I try to activate using command line:

stsadm -o activatefeature -name PublishingWeb -url http://mydomain.com/test
but got the following....

Provisioning did not succeed. Details: Failed to initialize some site properties for Web at Url: 'http://mydomain.com/test' OriginalException: List does not exist.
The page you selected contains a list that does not exist. It may have been deleted by another user.

After some further research, it looks like the hidden "Quick Deploy Item" and a host of other key list were not there.  Now sure how this happened but I have tried various suggestions to no avail. 

SOLUTION:  Okay... I open a support ticket with MS Support. We ended up solving the issue by issuing by following comannds:

stsadm -o activatefeature -filename publishing\feature.xml -url http://...-force
stsadm -o activatefeature -filename publishingresources\feature.xml -url http://...- -force
stsadm -o activatefeature -filename publishingSite\feature.xml -url http://...- -force
stsadm -o activatefeature -filename publishingweb\feature.xml -url http://...- -force
stsadm -o activatefeature -filename publishinglayouts\feature.xml -url http://...- -force
stsadm -o activatefeature -filename navigation\feature.xml -url http://...- -force

NOTE: You need to execute the aboe on all subsites that are affected. Hope this help someone.

Wednesday, February 8, 2012

Search not returning result for other domain users


I have a strange situation when users from other domain does not get any results when they perform a search. Here's the scenerio:
  1. I recently upgraded the farm from Sp2007 to Sp2010.
  2. Crawl jobs all completed successfully
  3. Our domains:
    - myco.com
    - eu.myco.com
  4. User from myco.com can search fine.
  5. Search performed by user from eu.myco.com return nothing... envon on simple search where I am sure they have access to. Also, they didn't have this problem in SP2007.
  6. These eu.myco.com users does have access to the sharepoint sites.
  7. It is similar to the issues describe in this discussion: http://social.microsoft.com/Forums/en-US/partnerofficesharepoint/thread/b547461a-e47b-4b54-980d-d6b36e244bae.  The fix was to add the search/servcie account to the Windows Authorization Access group.
  8. In my case, I need to add the service account to the Windows Authorization Access group on ALL the domains.

Missing Some Basic Webparts After SP2010 Upgrade

I have recently upgraded from SP2007 to SP2010 (enterprise). Now, when I try to add a webpart, I don't see the Content Editor webpart under the media category. I am a farm admin and I can see it. This is what I have done so far:
  • Checked the permission to webpart gallary. They all looked fine
  • Checked the site collection's publsihing infrastructure feature and site level publishing feature. They are both enabled already. I went and disable and re-eanble any way.
  • Went to Central Admin -> Upgrade and Migration and ran the "Enable features on Existing Sites".
  • Checked the webpart gallery but didn't see the MSContentEditor.dwp on the list. Click new but still see it from the list.
What what else am I missing.    I seem to be missing some basic webparts... webparts like RSS Feed is not showing up when I add webpart. 

Okay... after some more digging into his. I was able to resovle by running the following script to disable and re-enable the: 1) Basic Web Part; 2) Standard Site Collection Feature; and 3) Enteprise Site Colleciton Feature. The script traverse thru the web, locate the site collections, and disable/enable the features:

$webApp = Get-SPWebApplication -Identity http://yourwebapp
$webApp | Get-SPSite -limit all | ForEach-Object {Disable-SPFeature -Identity "BaseSite" -Url $_.Url -Confirm:$False}
$webApp | Get-SPSite -limit all | ForEach-Object {Enable-SPFeature -Identity "BaseSite" -Url $_.Url}
$webApp | Get-SPSite -limit all | ForEach-Object {Disable-SPFeature -Identity "PremiumSite" -Url $_.Url -Confirm:$False}
$webApp | Get-SPSite -limit all | ForEach-Object {Enable-SPFeature -Identity "PremiumSite" -Url $_.Url}

Note that manually deactivate and activate these features thru the Site Collection Feature page does not help. For some reason, it needs to be done thru the command line.

Wednesday, November 30, 2011

Sharepoint URL Quick List

How many times you want to remember the Sharepoint _layouts paths but don't remember the exact name?  Well he is a list that I found...  enjoy!


URL Description
URL
Create New Site Content
url: /_layouts/create.aspx
List Template Gallery
url: /_catalogs/lt
Manage People
url: /_layouts/people.aspx
Manage Site Collection Administrators
url: /_layouts/mngsiteadmin.aspx
Manage Sites and Workspaces
url: /_layouts/mngsubwebs.aspx
Manage User Permissions
url: /_layouts/user.aspx
Master Page Gallery
url: /_catalogs/masterpage
Modify Navigation
url:/_layouts/AreaNavigationSettings.aspx
Recycle Bin
url: /_layouts/AdminRecycleBin.aspx
Site Column Gallery
url: /_layouts/mngfield.aspx
Site Content and Structure Manager
url: /_layouts/sitemanager.aspx
Site Content Types
url: /_layouts/mngctype.aspx
Site Settings
url: /_layouts/settings.aspx
Site Template Gallery
url: /_catalogs/wt
Site Usage Summary
url: /_layouts/SpUsageWeb.aspx
User Alerts
url: /_layouts/sitesubs.aspx
View All Site Content
url: /_layouts/viewlsts.aspx
Web Part Gallery
url: /_catalogs/wp
Web Part Page Maintenance
url: ?contents=1
Workflows
url: /_layouts/wrkmng.aspx

Userful Powershell / STSAdm Commands

During my SP2010 upgrade process, on of the challenges I have is constently running PowerShell scripts and piping the results to a file so that I can parse and create new scripts against the results.  I have been doing it using the old way... like using "> test.txt".  Than I found ou that you can use the CovertTo and Export options with better and consistent results.  Below are a few examples:


TEST-SPContentDatabase -name MyContentDB -webapplication http://intranet -serverinstance MyDBServer  | ConvertTo-Html | Out-file intranet.html


TEST-SPContentDatabase -name MyContentDB -webapplication http://intranet -serverinstance MyDBServer  | ConvertTo-CSV -Delimiter "~" | Out-file intranet.csv


TEST-SPContentDatabase -name MyContentDB -webapplication http://intranet -serverinstance MyDBServer  | Export-CLIXML intranet.xml



Other PowerShell Commands useful around Upgrade

Get-Command -noun SP* - similar to stsadm -help
Test-SpContentDatabase – discussed in this post
Upgrade-SPContentDatabase – to resume failed upgrades
Upgrade-SPEnterpriseSearchServiceApplication – Upgrade Search
Upgrade-SPSingleSignOnDatabase – Upgrade SSO
Mount-SPContentDatabase – Used to attach a database or multiple parallel databases to the farm. Essentially is nearly the same as the STSADM –o addcontentdatabase.   If you‘re doing parallel content database attach for example, this PowerShell method is recommended. You‘d simply run each ofthese in different command/management windows.
Upgrade-SPProjectWebInstance – Upgrade Project Server databases. Obviously this only applies with Project Server deployments, but I know there are definitely many out there.
Upgrade-SPEnterpriseSearchServiceApplication – Upgrade the Search Service Application Instance. This commandlet it designed to upgrade the content sources and configuration of search and to upgrade it into the new service application.
Set-SPSite  -- Can use this command to setup site collection admins



STSADM Commands useful around preparing for Upgrade

stsadm -o ExportIPFSAdminObjects
stsadm -o MergeContentDB
stsadm -o EnumAllWebs
stsadm -o DatabaseRepair [-deletecorruption]
stsadm -o DeleteSite [-force] [-gradualdelete]
stsadm -o DeleteWeb [-force]
stsadm -o ForceDeleteList
stsadm -o VariationsFixupTool
stsadm –o Upgrade (Used for build to build upgrades, including service packs.)

"Type" column/icon does not work in Sharepoint 2010

In SP2007, if you add "Type" column to a view (for both document library and custom list), this icon will no longer clickable after you have migrated to SP2010.  For document library, there is a KB  from Microsoft to resolve this.  However, this KB does not work for custom list that you may have.  In order to fix the issue for custom list, you need to extent the solution from KB with addtion modifcations.  Thanks to Martin Truchon's response in this TechNet entry, the required changes as available..

To fix both doc lib and custom list issues, I have combined the above and summarize what need to be done:

1. Copy the contents below and save it in a file called fldtypes_docicon.xslt file and place it in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\XSL.

<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal" ddwrt:oob="true">
    <xsl:output method="html" indent="no"/>
 
  <xsl:template ddwrt:dvt_mode="body" match ="FieldRef[@Name='DocIcon']" mode="Computed_DocIcon_body">
    <xsl:param name="thisNode" select="."/>
    <xsl:param name="folderUrlAdditionalQueryString" select="''"/>
    <xsl:choose>
      <xsl:when test="
$thisNode/@FSObjType='1'">
        <xsl:variable name="alttext">
          <xsl:choose>
            <xsl:when test="starts-with(
$thisNode/@ContentTypeId, &quot;0x0120D5&quot;)">
              <xsl:value-of select="
$thisNode/../@itemname_documentset"/>: <xsl:value-of select="$thisNode/@FileLeafRef"/>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="
$thisNode/../@listformtitle_folder"/>: <xsl:value-of select="$thisNode/@FileLeafRef"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:variable>
        <xsl:variable name="mapico" select="
$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapico"/>
        <xsl:variable name="folderIconPath">
          <xsl:call-template name="GetFolderIconSourcePath">
            <xsl:with-param name="thisNode" select="$thisNode"/>
          </xsl:call-template>
        </xsl:variable>
        <!-- This is a folder -->
        <xsl:choose>
          <xsl:when test="$RecursiveView='1'">
            <img border="0" alt="{$alttext}" src="{$folderIconPath}" />
            <xsl:choose>
              <xsl:when test="
$thisNode/@IconOverlay != ''">
                <img src="
/_layouts/images/{$thisNode/@IconOverlay.mapoly}" class="ms-vb-icon-overlay" alt="" title="" />
              </xsl:when>
            </xsl:choose>
          </xsl:when>
          <xsl:otherwise>
            <xsl:variable name="FolderCTID">
              <xsl:value-of select="$PagePathFinal" />RootFolder=<xsl:value-of select="
$thisNode/@FileRef.urlencode" /><xsl:value-of select="$ShowWebPart"/>&amp;FolderCTID=<xsl:value-of select="$thisNode/@ContentTypeId" />&amp;View=<xsl:value-of select="$View"/><xsl:value-of select="$folderUrlAdditionalQueryString"/>
            </xsl:variable>
            <a href="{$FolderCTID}" onmousedown ="VerifyFolderHref(this, event,
'{$thisNode/@File_x0020_Type.url}','{$thisNode/@File_x0020_Type.progid}','{$XmlDefinition/List/@DefaultItemOpen}', '{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}', '{$thisNode/@HTML_x0020_File_x0020_Type}', '{$thisNode/@serverurl.progid}')"
               onclick="return HandleFolder(this,event,&quot;{$PagePathFinal}RootFolder=&quot; + escapeProperly(&quot;{$thisNode/@FileRef}&quot;) + '{$ShowWebPart}&amp;FolderCTID={$thisNode/@ContentTypeId}&amp;View={$View}{$folderUrlAdditionalQueryString}','TRUE','FALSE','{$thisNode/@File_x0020_Type.url}','{$thisNode/@File_x0020_Type.progid}','{$XmlDefinition/List/@DefaultItemOpen}','{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}','{$thisNode/@HTML_x0020_File_x0020_Type}','{$thisNode/@serverurl.progid}','{$thisNode/@CheckoutUser.id}','{$Userid}','{$XmlDefinition/List/@ForceCheckout}','{$thisNode/@IsCheckedoutToLocal}','{$thisNode/@PermMask}');">
              <img border="0" alt="{$alttext}" title="{$alttext}" src="{$folderIconPath}" />
              <xsl:choose>
                <xsl:when test="
$thisNode/@IconOverlay != ''">
                  <img src="
/_layouts/images/{$thisNode/@IconOverlay.mapoly}" class="ms-vb-icon-overlay" alt="" title="" />
                </xsl:when>
              </xsl:choose>
            </a>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:when>
      <xsl:otherwise>
        <xsl:choose>
          <xsl:when test="$IsDocLib">
            <a onfocus="OnLink(this)" href="
{$thisNode/@FileRef}" onmousedown="return VerifyHref(this,event,'{$XmlDefinition/List/@DefaultItemOpen}','{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}','{$thisNode/@serverurl.progid}')"
   onclick="return DispEx(this,event,'TRUE','FALSE','{$thisNode/@File_x0020_Type.url}','{$thisNode/@File_x0020_Type.progid}','{$XmlDefinition/List/@DefaultItemOpen}','{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}','{$thisNode/@HTML_x0020_File_x0020_Type}','{$thisNode/@serverurl.progid}','{$thisNode/@CheckoutUser.id}','{$Userid}','{$XmlDefinition/List/@ForceCheckout}','{$thisNode/@IsCheckedoutToLocal}','{$thisNode/@PermMask}')">
              <xsl:choose>
                <xsl:when test="not (
$thisNode/@IconOverlay) or $thisNode/@IconOverlay =''">
                    <xsl:choose>
                        <xsl:when test="not (
$thisNode/@CheckoutUser.id) or $thisNode/@CheckoutUser.id =''">
                            <img border="0" alt="
{$thisNode/@FileLeafRef}" title="{$thisNode/@FileLeafRef}" src="/_layouts/images/{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapico}"/>
                        </xsl:when>
                        <xsl:otherwise>
                            <xsl:variable name="alttext"><xsl:value-of select="
$thisNode/@FileLeafRef"/><xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&#10;</xsl:text><xsl:value-of select="$thisNode/../@managecheckedoutfiles_header_checkedoutby"/>: <xsl:value-of select="$thisNode/@CheckoutUser.title"/></xsl:variable>
                            <img border="0" alt="{$alttext}" title="{$alttext}" src="
/_layouts/images/{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapico}" />
                            <img src="/_layouts/images/checkoutoverlay.gif" class="ms-vb-icon-overlay" alt="{$alttext}" title="{$alttext}" />                           
                        </xsl:otherwise>
                    </xsl:choose>                 
                </xsl:when>
                <xsl:otherwise >
                    <img border="0" alt="
{$thisNode/@FileLeafRef}" title="{$thisNode/@FileLeafRef}" src="/_layouts/images/{$thisNode/@IconOverlay.mapico}" />
                  <img src="
/_layouts/images/{$thisNode/@IconOverlay.mapoly}" class="ms-vb-icon-overlay" alt="" title="" />
                </xsl:otherwise>
              </xsl:choose>
            </a>
          </xsl:when>
          <xsl:otherwise>
   <a onfocus="OnLink(this)" href="{$FORM_DISPLAY}&amp;ID={$thisNode/@ID}" ONCLICK="GoToLink(this);return false;" target="_self">
     <img border="0" src="
/_layouts/images/{$thisNode/@HTML_x0020_File_x0020_Type.File_x0020_Type.mapico}">
    <xsl:attribute name="alt">
      <xsl:value-of select="
$thisNode/@Title"/>
    </xsl:attribute>
    <xsl:attribute name="title">
      <xsl:value-of select="
$thisNode/@Title"/>
    </xsl:attribute>
      </img>
   </a>  
          </xsl:otherwise>
        </xsl:choose>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
 
</xsl:stylesheet>



2. IISReset

3. Perform the prior steps in each WFE servers.

Monday, November 28, 2011

Preparing to upgrade Sharepoint 2007 to SP2010

Well, after about 3 months worth of testings and preparations, I am about to upgrade our midsize SP2007 to SP2010 this coming weekend.  I will be doing a database attached method on a newly created "production" SP2010 farm.  In short, this is what I have:
  • 2 x WFE (HyperV VMs)
  • 4 x App Servers - Index, Enterprise Apps, SSRS, Project, SSAS, TFS (all HyperV VMs)
  • Clustered SQL 2008 R1 Servers (Physical)
We have about 10 databases totalling ~200GB.  This is going to take 2-3 hours to complete.  I know some of you would tell to do parallel upgrade.  I have tried that but have seen quite a bit of lock message on the SQL server.  To keep it safe, I am going to do this one-by-one.  At the moment, my newly created farm already has all the required custom applications/solutions deployed.  Since I have been doing mark-up db-attached on this farm for weeks, I have already documented/resolved any issues before hand.  On the day of the migration, here is what I am planning to do:

  1. Update the DNS to redirect all incoming traffic to a temp server
  2. Update MS Exchange to hold incoming email and than change the seetings to point to the two new WFEs.
  3. Backup the DBs from SP2007 servers restore it to the new cluster SQL
  4. Attached the restored DBs and grant the SP accounts the proper permissions
  5. Perform the upgrade one by one using Mount-sPContentDatabase.  When this is all done, I should be able to hit the sites.
  6. Re-deploy all the solutions
  7. Run the "Enable Features On Existing Sites" option to push down all the enterprise features.  If I don't do this, I've noticed that some of my SP2007 workflows would break.
  8. Run TEST-SPContentDatabase to see if there are issues.  Chances are I would see some but as long as not show-stopper, I am okay with it.
  9. I take this opportunity to move/re-locate any site collections to the proper content database... just to keep thing organized.
  10. Have a few users "smoke" test it.
The above are just high level view of what I'll be going thru.  There are alot more steps.  I will post the actual result and finding once I am done upgrade.

Cheers...

Friday, September 30, 2011

Service Topology for Mid Size Farm

I am working on upgrade SP2007 to SP2010.  Below chart is a snapshot of  how I am planning to distribute the service across the various servers.  The goals are:
  1. Properly distributed the load across the servers
  2. Build a level of redundancy
  3. Prove a scalable environment
I know I will need to make adjustments along the way.  This will at least give me a starting point.  Hope this will help you guys out as well.


Server NameWFE1WFE2APP1APP2PROJECTSSRS
Access DB Servicesxx
Application Registry Service      
Business Data Connectivityxx
Central Administrationx
Document Conversionsxx
Document Conversions Load Balance Servicexx
Excel Calculation Servicesxx
Lotus Notes Connector      
Managed Metadata Web Servicexx
MS Sharepoint Foundation Incoming E-Mailxx
MS Sharepoint Foundation Subscription Settings Service      
MS Sharepoint Foundation User Code Service      
MS Sharepoint Foundation Web Applicationxx
MS Sharepoint Foundation Workflow Timer Servicexxxx
PerformancePoint Servicexx
Project Application Servicex
Search Query and Site Settings Servicexx
Secure Store Servicexxxx
Security Tokenxxxx
Sharepoint Foundation Search      
Sharepoint Server Searchxxxx
User Profile Servicexx
User Profile Synchronization Service (only run on 1 server)x
Visio Graphics Servicexx
Web Analytics Data Processing Servicex
Web Analytics Web Servicex
Word Automation Servicesxx
REMARKS
- For SP Search Search:
   -> Both WFEs will hold the progogated index
   -> Both APPs will host the Admin/Crawl component