Monday, December 9, 2013

Upgrade iLoveSharePoint Workflow actions for SPD to 2013

After test upgrading my Project Portal, I was not able to edit the custom workflow I had built in SPD using the iLoveSharePoint Workflow action from Codeplex (which is awesome btw).

I struggled a bit with this today but finally found the perfect solution if you want to upgrade this workflow action for SharePoint 2013. I use this workflow action to automate the creation of project sites at our company intranet and find it very useful.

So first start with adding and installing the wsp file again on the SP 2013 server:

Add-SPSolution d:\xxx.wsp (where ever you store the wsp file)
Install-SPSolution iLoveSharePoint.Workflow.Activities.wsp -GACDeployment -CompatibilityLevel {14, 15}

Then you need to also edit the web.config file (and I have had to do this for all my custom wsp files) and move this section:


into the "targetFx" section:



    
I did an IISRESET right after, and then made sure it got deployed in "Farm solutions" in CA.

When you open the workflow in SharePoint Designer 2010, this is what it should look like:


But when you open it in SPDF 2013 you will have to add back the custom actions, they are gone of course. So add back the custom actions, make sure the workflow looks like it should and publish it again to your site:

Monday, December 2, 2013

Unexpected error when changing the Top Navigation

When I had all the problems with our Replicator, and after it was finally solved, it started replicating the map and navigation structure. I desperately tried to stop the replication because I could see that it was altering my Top Navigation which I don't wanted. But the damage was already done, and I went into the Site Actions and Navigation and thought I just change it back. Nooooo. After replication had changed it and I tried to stop it something must have happened because I got this error message now:

"An unexpected error occured while manipulating the navigational structure of this Web"

 
So I could no longer change the Navigation, and all I wanted to do was to reorder it under "Global Navigation". Another important thing, I could change the navigation on subsites! But not on the top site in my site collection.

Googled the error and found that this had been resolved with April CU 2013. Upgraded to that, but it did NOT resolve my problem.

Went through the ULS logs and it reported:

"System.Data.SqlClient.SqlException: Cannot insert duplicate key row in object 'dbo.NavNodes' with unique index 'NavNodes_AltPK'. The duplicate key value is (25a584d5-0f03-4bb5-bdea-2e57030c7817, 4e340cbd-639b-4d6e-aa19-cdb73ac35a00, 1002, -7).  The statement has been terminated.     at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)     at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)     at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)     at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()     at System.Data.SqlClient.SqlDataReader.get_MetaData()     at System.Dat... 852bae04-377b-43d5-b8f5-f354a1eb54b2
10/01/2013 13:55:02.05* w3wp.exe (0x2C34)                        0x07A0 SharePoint Foundation          Database                       d0d6 High     ...a.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)     at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)     at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)     at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)     at Microsoft.SharePoint.Utilities.SqlSe... 852bae04-377b-43d5-b8f5-f354a1eb54b2
10/01/2013 13:55:02.05* w3wp.exe (0x2C34)                        0x07A0 SharePoint Foundation          Database                       d0d6 High     ...ssion.ExecuteReader(SqlCommand command, CommandBehavior behavior, SqlQueryData monitoringData, Boolean retryForDeadLock)     at Microsoft.SharePoint.SPSqlClient.ExecuteQueryInternal(Boolean retryfordeadlock)     at Microsoft.SharePoint.SPSqlClient.ExecuteQuery(Boolean retryfordeadlock) 852bae04-377b-43d5-b8f5-f354a1eb54b2
10/01/2013 13:55:02.05  w3wp.exe (0x2C34)                        0x07A0 SharePoint Foundation          Database                       8z23 Unexpected Unexpected query execution failure in navigation query, HResult -2146232060. Query text (if available): "BEGIN TRAN DECLARE @abort int SET @abort = 0 DECLARE @EidBase int,@EidHome int SET @EidBase = 0 SET @EidHome = NULL IF @abort = 0 BEGIN EXEC @abort = proc_NavStructAllocateEidBlockWebId @wssp0, @wssp1, @wssp2, @EidBase OUTPUT SELECT @wssp3 = @EidBase, @wssp4 = @abort END IF @abort = 0 BEGIN EXEC @abort = proc_NavStructMoveNode '25A584D5-0F03-4BB5-BDEA-2E57030C7817','4E340CBD-639B-4D6E-AA19-CDB73AC35A00',4945,1002,-2,N'20130928 16:17:25',@EidBase,@EidHome, @wssp5 OUTPUT SELECT @wssp6 = @abort END IF @abort = 0 BEGIN EXEC proc_NavStructLogChangesAndUpdateSiteChangedTime @wssp7, @wssp8, NULL END IF @abort <> 0 BEGIN ROLLBACK TRAN END ELSE BEGIN COMMIT TRAN END IF @abort = 0  BEGIN EXEC pro... 852bae04-377b-43d5-b8f5-f354a1eb54b2
10/01/2013 13:55:02.05* w3wp.exe (0x2C34)                        0x07A0 SharePoint Foundation          Database                       8z23 Unexpected ...c_UpdateDiskUsed '25A584D5-0F03-4BB5-BDEA-2E57030C7817' END " 852bae04-377b-43d5-b8f5-f354a1eb54b2
10/01/2013 13:55:02.05  w3wp.exe (0x2C34)                        0x07A0 SharePoint Foundation          General                        8kh7 High     An unexpected error occured while manipulating the navigational structure of this Web. 852bae04-377b-43d5-b8f5-f354a1eb54b2"

So values that the top navigation is using, are duplicated in a table called "dbo.NavNodes" in the content db. Or are invalid somehow.
I opened the dbo.NavNodes db and copied all lines in it, to find that duplicate key "(25a584d5-0f03-4bb5-bdea-2e57030c7817, 4e340cbd-639b-4d6e-aa19-cdb73ac35a00, 1002, -7)" and it was just a page on the site, checked in and published. Cannot really see how this page would mess all up, it has been there for quite a long time also.

I found an article that suggested to run a SQL query on the content db, to find the duplicates:

SELECTTOP(20)Count(nav.Eid)AS 'DuplicateCount', nav.DocId, ad.Dirname, ad.Leafname FROM NavNodesAS nav with(nolock)INNER JOIN AllDocsAS ad with(nolock)ON nav.Docid = ad.Id WHERE nav.EidParent= 1025 AND DocID IS NOT NULLGROUP BY nav.DocId, ad.DirName, ad.LeafNameORDER BY 'DuplicateCount' DESC

And the result was:
 
 
 
So I knew that some nodes were corrupt, and finally I found a useful article that really helped solving my problem. I ran this command a few times and carefully testing the Navigation between each, (go to Site Actions and Navigation and try to change the order in the Global Navigation). I had to run the script that deletes the nodes a couple of times (three):

Open PowerShell on the server, check the size of those objects at the top level:

$siteUrl = "http://server"
$spWeb = Get-SPWeb $siteUrl
$spWeb.Navigation.QuickLaunch | ft Title
$spWeb.Navigation.TopNavigationBar | ft Title
 
Then delete the QuickLaunch Nodes using this cmd:

$siteUrl = "http://server"
$spWeb = Get-SPWeb $siteUrl
    Foreach($node in ($spWeb.Navigation.QuickLaunch))
{
    write-host "The node title is "$node.Title
    $node.Delete()
}
$spWeb.Dispose()

Then delete the TopNavigationBar Nodes:

$siteUrl = "http://server"
$spWeb = Get-SPWeb $siteUrl
    Foreach($node in ($spWeb.Navigation.TopNavigationBar))
{
    write-host "The node title is "$node.Title
    $node.Delete()
}
$spWeb.Dispose()

First when you run these commands you will get an error message: "Cannot complete this action" and just continue until that goes away:
 


You know when you should stop because then you don't get a red error message any longer:


Now I went into the Site Actions > Navigation again on my site collection and now I could change the order and save.

Monday, October 21, 2013

Setup an app store in SharePoint

If you want to create your own SP app store, then you need to go through quite a few steps..
Here we go!

In Central Admin

First create a new app catalog site

 
I created one on http://server:2013/sites/apps  
Create the app mgmt service application and the Subscription service app





Create the subscription service app

$account = Get-SPManagedAccount domain\account

$appPool = New-SPServiceApplicationPool -Name SubscriptionServiceAppPool -Account $account

$serviceApp = New-SPSubscriptionSettingsServiceApplication -ApplicationPool $appPool -name "Subscription Settings Service Application" -DatabaseName "SubscriptionSettingsDB"

$serviceAppProxy = New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $serviceApp
 
Then make sure the services are started, both for App Management and for Subscriptions
Then stop the Timer service
Restart the WWW service
Start the Timer service

Create an alias on your DNS (or use whatever apps domain you want), like apps.yourserver.com
Add that URL in the Configure Apps URL in CA and the prefix you wish to use (I chose "apps")






On your site
Make sure Publishing site collection features are activated
When you choose "Add an app" and click on "From your organization", any apps you have added should be visible now:

 

Wednesday, September 11, 2013

Search hangs on "Starting"

I think I know why this happened from the beginning. I got the warning message in Health Reports about having Admin accounts running the app pools or services. So I have corrected one account and now all these messages are gone. But that caused a new problem with Search Service. The error message was:

"Unable to retrieve topology component health states. This may be because the admin component is not up and running."
 
Googled it, and found lots of articles about this error. Most suggestions was about installing hotfixes, adding permissions directly in the SQL db's, changing environment variables, installing latest win updates etc etc.

But I had a feeling it had more to do with the accounts running the Search services or application pools. I had changed some of these from farm account to a specific service account, for security reasons and what MS recommends. But, after having changed back the SharePoint Search Host Controller to the farm account, (Go to "Security", "Configure service accounts" and select the "Windows Service - Search Host Controller Service", make an IISRESET afterwards) and all started working instantly.



Maybe not recommended, but I will keep it running like this. The message in the Health Analyzer has not come back so, so far so good.

Wednesday, September 4, 2013

Unable to start UPS due to Event 6398 on SP2013


This happened on a fresh install of SharePoint 2013 on a Win 2012 server, without any CU's applied. When I started the User Profile Service Application it hung and just when into "Stopped" mode.
Checked the Event Viewer and found this error, Event 6398:
“The Execute method of job definition Microsoft.Office.Server.UserProfiles.LMTRepopulationJob (ID 84821b32-cf9f-45ff-801b-bb25b69faa6f) threw an exception. More information is included below.
Unexpected exception in FeedCacheService.IsRepopulationNeeded: Connection to the server terminated,check if the cache host(s) is running .”

And
“The Execute method of job definition Microsoft.Office.Server.UserProfiles.LMTRepopulationJob (ID 84821b32-cf9f-45ff-801b-bb25b69faa6f) threw an exception. More information is included below.
Unexpected exception in FeedCacheService.IsRepopulationNeeded: Cache cluster is down, restart the cache cluster and Retry.”

 


Googled on this and found this article:
Ran the following Powershell cmdlet:
Get-CacheHostConfig -ComputerName $env:computername -CachePort 22233
But got the following error, "No valid cluster settings found..."

 
According to the article I had to create a CacheCluster, by following the steps in this article from MSDN:
I ran the setup to install the Windows Server AppFabric caching features, but got an error (only extracts from the entire log file):

=====
2013-09-04 09:11:50, Information           Setup  Product:          Microsoft(R) Windows(R) Server AppFabric
2013-09-04 09:11:50, Information           Setup  ProductVersion:   1.1.2106.32
2013-09-04 09:11:50, Information           Setup  OS Name:                   Windows Server 2012
2013-09-04 09:11:50, Information           Setup  Event Registration Source :    AppFabric_Setup

2013-09-04 09:11:50, Error                 Setup  One or more of the specified features are already installed.
=====

So I reconsidered the situation and decided to just go in and stop the AppFabric Service instead and then try to launch the UPS. And that worked :) 
The Forefronte services now came up!
First I made an IISRESET, as that is always necessary after having launched the UPS.

And then I rebooted the server and see if the UPS still works when the AppFabric service gets started.
The AppFabric service was started and the UPS service was still started and I could add a new AD connection.
Now I will proceed and install the CU's.

Sunday, June 30, 2013

How to replicate InfoPath forms with data connections

As I have written about before replication of InfoPath forms that are using data connections, has not been working using Metalogix Replicator http://sharepointbabe.blogspot.ae/2013/01/infopath-forms-do-not-work-with.html
But now this has been resolved by Metalogix and here are the steps needed to make this work.

1) The latest version of Replicator must be installed, that is version 6.0.7812.0

2) Make sure the AAM default zone are matching on all servers (this is most important if the local servers are using split DNS, which means that the URL headers are the same on all servers and a request to the same URL points locally instead of to the hub). Then setup any of the other zones to be individual, I have used the Intranet zone:









3) Setup the InfoPath forms to use udcx files. To do this, create a Data Connection library on your site and then convert all the data connections in the form to .udcx files and store them in the library:








4) The udcx files should be stored in a Data Connection library on a site where users have Read access, and it should also be added for replication.

 

Sunday, June 16, 2013

Create a page layout using Design Manager

I want to create my own layout for use on the intranet front page. I don’t want to have a left side menu and I want three columns where the middle one should be the widest. There is no page layout that fits my need so I will create my own.

Go to Design Manager
Click on “Edit page layouts“

And then “Create a page layout”
 

 
 
 
 
Give your new page layout a name and choose what MasterPage you want, then finally pick a page layout to inherit from: 

 

 
Your page is now created




But that is not the file you should edit, instead edit the corresponding html file. To do that, you need to map the "_catalogs/masterpage" folder to a drive:

In Windows Explorer, click on “Map network drive” and add the following path to a drive:
Then you will be able to edit the html file that your page layout is connected to. As you can see, that html file is automatically created:



Open the html file in any editor and insert your own html code between these two tags:


Save the file and the page layout is updated (and you might have to approve the page layout file also)

Thursday, June 13, 2013

Upgrade part 6: Upgrade MySites to SP2013

This is how I upgraded our SP 2010 mysite site collections to SP 2013

Restored a copy of the 2010 database for MySites to my test server
Removed the content db in CA
Detached the db in SQL
Attached the restored copy in SQL
Added the content db in CA

Do an iisreset

Now ready for some test runs…

Test-SPContentDatabase -name MySites -webapplication https://server:3334 | out-file e:\upgrade\upgrade.txt -width 500

Got some errors about missing webparts or customizations which is fine, I don’t want to use them anymore anyway. Most errors are regarding the office web apps though but none of them is blocking upgrade so I will go ahead:

Category        : MissingFeature
Error           : True
UpgradeBlocking : False
Message         : Database [MySites] has reference(s) to a missing feature: Id = [893627d9-b5ef-482d-a3bf-2a605175ac36], Name = [PowerPoint Mobile Viewer], Description = [Enables viewing of PowerPoint presentations in the mobile web browser], Install Location = [MobilePowerPointViewer].
Remedy          : The feature with Id 893627d9-b5ef-482d-a3bf-2a605175ac36 is referenced in the database [MySites], but is not installed on the current farm. The missing feature may cause upgrade to fail. Please install any solution which contains the feature and restart upgrade if necessary.
When this was done, I just detached the db from SQL, copied it to my new SP2013 server and then it is ready to be migrated.

Did the same on the SP2013, that is remove the content db from the MySites web app. Attach it on the SQL and then in CA again:









But then you cannot add the content db directly from CA, you need to mount it:

Mount-SPContentDatabase “MyDatabase” -DatabaseServer "MyServer" -WebApplication http://server:5230



After mounting I got this message




Yeah I have a look later, I think I know what the error messages is. I had a customized template for the MySites on my 2010 server and that is not included in this upgrade. Will just skip it and proceed.

Made an iisreset

Got access denied when trying to access MySite (the old classic Access Denied message from 2010) as my self:





 
Signed in as the administrator and that MySite which I could access (so only Admin could access MySites right now)

Got the message about upgrading the site collection so I did that by clicking "Start now" up in ribbon:

 








After that, I visited my own site again and got the "new" access denied message:


That means that no users can access their MySites. So I decided to upgrade my site collection to see if that fixed the issue. You can run "get-SPSite" in powershell to see a list of what versions the site collection are. All our mysites were in 14, they need to be converted to 15. Run the Upgrade-SPSite command in powershell (of course this must be scripted for all users…):

Upgrade-SPSite http://server:5230/personal/lr00554 -VersionUpgrade

Tried to access my personal MySite again, but still access denied "Site has not been shared with you"

I looked at the Authentication Provider for my MySite web app and that said "Claims based authentication" but maybe all site collections are not included? My last test was to upgrade the authentication for entire web application including all migrated mysite site collections.

In Powershell:
Convert-SpWebApplication -Identity "http://server:5230" -To Claims -RetainPermissions [-Force] 

And TADA, the new MySite is up and accessible!




Saturday, May 25, 2013

My experience of using Replication


I have used replication between 8 SharePoint server farms for almost a year now. I am usually a very nice and patient person, but now the patience is running out and I feel frustrated and need to write about this so maybe it can help others who are considering replication. And I am being brutally honest (sorry to all you nice people at Metalogix), but I have had it and I want to share my experience!
I used to have a nice job as the only SharePoint employee (a new role for me who always worked as a consultant) in the company, maintaining and developing our intranet in a small server farm. The company I work for is in the seismic industry and we have a fleet where the vessels have a limited amount of bandwidth. They use satellites for bandwidth, and currently they only have a 1 Mb connection. Which is a big challenge for SharePoint, as it is not supported over WAN. Our fleet users of course found our SharePoint intranet very slow (connecting to our server in Dubai), which is understandable on such a low bandwidth. So to solve this, I started to evaluate some replication products, since Microsoft does not have a product or a solution for this. And hey Microsoft, I know the cloud is the new thing ánd that is cool when you have a lot of Mb's, but what about your users that has limited low bandwidths and MUST have data available if they become offline (which happens quite often at sea)?
Anyhow, I chose Metalogix Replicator because they have been in the business for quite a while, they have similar clients and also their product is built into the CA so we did not need another client to monitor the replication. It seemed to fulfill all our needs also, and with that I mean that we have a very “out of the box” intranet so it should not be complicated to replicate the functionality.
Could have been a success story for us. But the truth is, almost a year later, I barely have any time over to do my regular job because of all the replication issues and we still are not replicating all functionality! My job has become a nightmare, where I have to fix things that the replication has messed up or monitor the package queues to see what has run into “error” or “conflicts”. It was a long time ago I could sit down and have a look at new development projects on the intranet. So why is it like this? Well first the obvious reason, and which is not due to the product (it would be the same with any replication product), is that I now have 8 instead of 1 SharePoint servers (and SQLs) to maintain. I have 8 instead of 1 intranet sites to monitor and all the work that comes with that. But that was expected and OK. I expected that to take maybe 40-50% of my time which should have been fine.
What I did not expect was the constant (I mean almost 100%) need of my time to monitor what the replication has done since I left it. That is, fearing that permissions has been removed or not replicated at all or replicated incorrectly so that sensitive information became visible (luckily I managed to restore permissions FAST before too many users discovered it), site collection features that got deactivated and ruined data from third party products we had installed (and that are critical for the safety on board) which led to a complete RESTORE of a site which took almost 2 days to get back (and unavailable to users of course), all the countless hours of troubleshooting errors and phone meetings with technical support! And also the lack of product support in replicating InfoPath forms. Which is still not solved, although stated to be solved in the last version. The product does not deliver what it promises!
Our intranet is very “out of the box” although it does not look like it, I can do magic without code J So it does not contain any custom code, I have branded it using our own css file, added some jquery stuff, and InfoPath or modified xsl. And also, we have used proper third party web parts that we have bought and used no “homemade” stuff. So I would expect that our functions should be easy and able to replicate. But I was wrong.
I have provided Metalogix with detailed descriptions of the errors both in replication of permissions, workflows and InfoPath replication. Their product manager have interviewed me to hear my opinion on the UI and I had a lot of improvement suggestions after having using it for half a year. But despite that, our problems are still there and I have been very patient but I can feel it running out now and it is getting really annoying instead. It is taking TOO much of my daily work and the users are annoyed that they STILL need to surf into our local office server to be able to fill in their Reimbursement forms etc (not to mention the confusion as they have to surf into ANOTHER url to do some stuff). I had hoped all this could be available on board when the replication was installed, which is almost a year ago now. I do understand that our third party web parts cannot be replicated, that is fine but COME ON! – forms using Data Connections which is by design in InfoPath? Lists with customized forms are not replicated in full (the ifs files are missing)? Permissions with only SP groups and AD groups in them? Workflow that sends repeated mails from the same form to users so they are SPAMMED and mail me in desperation to stop the replication, because it loops the packages and constantly “updates” the list items (when they are in fact NOT updated, just sent back and forth between the servers) but makes the workflow engine think they are updated items? List/document items with versioning enabled generates so many packages that I need to disable the replicator and it takes forever to clear the queues?

What I wonder is: where are all the other replication customers and their demands/problems? They must have the same issues as us? I seriously doubt that we are alone in this. And I can’t help but feel that I am contributing to the development of their product and usually I love to contribute with that to a company that listens, but this feels like BASIC product functionality that is already promised to be there. And it has cost us a LOT of troubleshooting and valuable time and dissatisfied users.
And not only the time at work… all my sleepless nights when I worry about this shit, afraid that users can see what they shouldn’t and the weekends I have had to spend solving things in panic or with a restore, instead of relaxing. All the hours where I have had to add back lost functionality, over and over!

Yes, there are good sides of Replicator also of course. It works really well for simple lists, pages, images and documents, (unless you use versioning, which can lead into endless loops where the package queues are so huge that you have to disable replication to be able to delete the hundreds or thousands packages that a FEW changes made in a list!), and it transfers the packages fast and at its smallest amount of data. Also I like the simple UI, and that it is integrated into CA.
And the people working at Metalogix are great and tries to help in all way, and I feel that they really take our problems seriously. But that does not help my frustration unfortunately, and they don’t seem to test real life scenarios since they obviously not had tested an InfoPath form that has Data Connections, and that is often the reason why you use IP in the first place, otherwise you could just use the simple lists.

So to conclude – using Replicator for simple, not customized, things works absolutely fine and it is indeed instant! But if you have an intranet with InfoPath forms using DC's, unique permissions, workflows, versioning etc then you might run into the same problems as we have and I would not recommend replication until all these issues are solved. We are using version 6 which is the latest version.
I hope with this article that I might find someone out there who is also using Replication (any products). Because when you google stuff about replication, you rarely find anything useful. It would be great to get some feedback and stories from others about this!

Monday, April 29, 2013

Upgrade to SP2013, part 5: Setup the User Profile Service Application

One thing that is introduced (or has come back actually) in SP2013 is: AD import. The big benefit of using ADI is that it is fast and easy to setup. Also, the filters are ready so you can just check a box to filter out disabled accounts!! Great! Not much can go wrong there.

But, if you want to fully use the UPS and maybe import extra attributes from the AD like user profile pictures, employee information etc then you must setup the User Profile Synchronization import. And I want to do that, especially import the photos, since I have a profile picture of the user up in the right corner of our intranet. This means a bit more work, but it is still quite easy to configure and setup:

Start with creating the User Profile Service Application in "Manage service applications" and map it to a new application pool (which I add the farm account to). You need to have that user in the local admin group on your server also. And yes, you will have a message about this in the Health Analyzer but just ignore that.

When that is done, go to the Services on Server and launch the two services “User Profile Service” and “User Profile Synchronization Service”. Enter the farm admin password on the page where you launch the second service. Now the last one will take some time to start, just leave it for 5-10 minutes and it will be started. One important thing I learned at the SPEVO13 conference, at a session by Spencer Harbar, was that the field where you enter the farm account password is actually not validated so if you enter an incorrect password there you might run into the famous “hang” when starting this service. So be sure you enter the correct password! I tried it and it does hang AND it did lockout my account until it finally stopped trying (new account policy for some admin accounts at my company) but it really does not tell you that the password is incorrect when you press OK on this page. Bad!!

Anyway, when you have the services started like this you can make an IISRESET:


I always do that, because I know this can give you errors or trouble otherwise when you want to create the AD connection and I am always better safe than sorry.

Now, go back to your User Profile service application and make sure the “Configure synchronization settings” are set to “Use SharePoint Profile Synchronization” and (optional) deselect the “Include existing BCS Connections for synchronization” for now since we don’t use that yet.

To setup the connection to your AD, go to “Configure synchronization connections”. When that is done, we need to setup the connection filters, in the most complicated and non logical way you can think of… to filter out the disabled accounts. Do this:
On your new AD connection, hover it and select “Connection filters”:





Make sure you have the “All apply (AND)” checked
Select “userAccountControl” in the list and wait for it to update the page!
Select operator “Bit on equals” and set the Filter to “2”
Click on “Add”:















If this is enough filters, just click OK to apply.

Now go back to your User Profile Service Application using the breadcrumb…. Hahaha NOT. Spencer made that joke at the SPEVO conference, not sure how many got that… I was laughing anyway!

So go all the way back to your UPS and start the synchronization, and yes it has to be a Full the first time.

Optional: before you start the import you can import some extra attributes from the AD. I want to add the user profile pictures:

Go to the “Manage User properties” and find the one called Picture. Change the settings to “Do not allow users to edit” if you don’t want your users to upload their own pictures (can result in everything from pics of cats, beers, strange positions etc if you allow this!) and then select the “thumbnailPhoto” from the attributes list. “Direction” should be “import” and click on Add:


 



Now start the full import and the time it takes to import of course depends on how many users you import and how many extra attributes. For me it took about 7 minutes to import 1700 users.

One last thing I do, is to select the User Profiles service app (go to "Manage service applications" view), select the UPS and click on “Administrators”. I add the Search account and set it to “Retrieve People Data for Search Crawlers” so I know that the People search will work also.

Sunday, April 28, 2013

Upgrade to SP2013, part 4: Upgrade Managed Metadata Service App

I will only upgrade one service app and that is the Managed Metadata service application, since I have built the company wiki based on a taxonomy tree there.

There is an article on technet that I followed to update this, but it failed. I tried it twice and got the same error and I am sure I missed something or did something wrong somewhere, but there is a limit on how many trials you do before you give up. So I did my own workaround and got it to work finally.

These are the recommended steps that I followed from Technet:
Detach the Managed metadata database on the SP2010 test server
Copy it to the new SP2013 server
Attach it to the SQL server
Then run this command in Powershell to upgrade the database:

$applicationPool = Get-SPServiceApplicationPool -Identity 'SharePoint Web Services default'

$mms = New-SPMetadataServiceApplication -Name 'Managed Metadata Service Application' -ApplicationPool $applicationPool -DatabaseName 'Managed Metadata Service'
(If you use a variable like $mms (or whatever you want to call it), you can refer to that when you create the proxy group):
New-SPMetadataServiceApplicationProxy -Name ‘Managed Metadata Service Connection’ -ServiceApplication $mms -DefaultProxyGroup

Did an iisreset just to be sure...

Right. So the result was an error message when I tried to access the Managed metatadata service app.

Opened the Properties to make sure it had the correct database (the upgraded db name) and application pool. And I actually created a new application pool and assigned the correct service account to that. That did not change anything.

Then I verified that the same service account has permissions to the database on the SQL server also.
Checked the Health Analyzer. Found a message about the managed metadata not being associated to the service apps:



Checked the “Configure service application associations” and the service apps were correctly associated.
Went back to Health analyzer and clicked on “Reanalyze now” and the message disappeared. Did not change anything.

Went into “Upgrade and Migration” and clicked on “Check upgrade status” and found the successful upgrade message so the database seems to be OK:
 


Clicked on the second Managed metadata service connection level and checked the second box also. I did not expect any changes from this, but just in case….

Went into “Security” and “Configure Service Accounts” and changed to another pool account and made an iisreset to see if that helped. No, did not change anything, still same error.

Checked the ULS and found this error:
Failed to get term store for proxy 'Managed Metadata Service Connection'. Exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.     at Microsoft.SharePoint.Taxonomy.Internal.XmlDataReader.GetDateTime(String name)     at Microsoft.SharePoint.Taxonomy.Internal.SharedTermStore.Initialize(IDataReader dataReader, Guid termStoreIdValue, Boolean fromPersistedData)     at Microsoft.SharePoint.Taxonomy.Internal.SharedTermStore..ctor(IDataReader dataReader, Guid termStoreId, Boolean fromPersistedData)     at Microsoft.SharePoint.Taxonomy.Internal.DataAccessManager.GetTermStoreData(MetadataWebServiceApplicationProxy sharedServiceProxy, Boolean& partitionCreated) 3a24169c-4427-a0a0-8c09-185263be83c0
04/28/2013 14:01:11.13  w3wp.exe (0x2EDC)                        0x1E80 SharePoint Server              Taxonomy                       8088 Warning  The Managed Metadata Service 'Managed Metadata Service Connection' is inaccessible. 3a24169c-4427-a0a0-8c09-185263be83c0

Googled these errors and found nothing that really related and could solve my problem ("the given key was not present").

Gave up and tried my own solution, which worked immediately! Steps follows below:

My own solution
Detached the database
Deleted the Managed Metadata service application in CA that I had created in the steps above
Created a new managed metadata service application and also a new application pool account.
And I checked “Add this service application to the farms default list”.
Attached the upgraded database (from my former steps above, so the database needs to be upgraded)
Changed the properties of the service app, and added the name of the upgraded database
Iisreset just to be sure…
It worked immediately.

May not be the correct way, but at least this worked on first shot!

Thursday, April 25, 2013

Upgrade to SP2013, part 3: What to migrate

Content databases
Number and size of databases. Any old that should not be moved over?

Custom solutions and branding
Identify: customizations, branding files, style sheets, farm solutions, customized web parts and copy/install all these files on the new server.
Make sure the third party products or any farm solutions are compatible with SP2013.

Database structure
Should we split the database into smaller databases? The test migration will be a good test for this, to see how long the upgrade takes. I really don’t want to split our intranet into different db’s because we would have to use different host headers or managed paths and it will confuse the users. Also since we are replicating, it means even more work to enable all those extra db’s for replication. I am sure that our db is quite small compared to what Microsoft recommends. Our intranet db is separated from the project portal, so the large amount of files should be moved out of the intranet.

Service apps
Search service app – NO
We are using pretty much out of the box for Search, I have only made some branding. So no, it will be fairly quick for us to setup a new index.

User Profiles - NO
Managed metadata – YES
We have not setup any company metadata because of the issue with editing multiple documents, that was in SP 2010. But now that you actually can make good use of it, we might consider adding it back. But I have used it for our company wiki so this will be needed.

Web Analytics – NO and shut down services
Analytics processing for SharePoint 2013 is now a component of the Search service, so stop the services before moving the content db’s. Web Analytics Data Processing Service and Web Analytics Web Service  services should be stopped and also go into “Monitoring” and disable the timer jobs for it. Maybe overkill but… better safe than sorry. Did not do that for this WSS_Content DB since the web app was not configured anyway! Test to see if any errors comes out of that.

PowerPoint Service App and Word Viewing Service App – NO
These apps were created to support our Chrome users, it is OfficeWebApps service applications. But they are moved out to their own server in SP2013, OfficeWebApps server.

SSL certificates
We use SSL on all our sites so this needs to be imported to the IIS.

AAM
Make sure all host headers are added to the AAM.

Quotas
We have increased our quota templates on the SP server so these values needs to be added. And of course the upload size limit.

Workflows
They should work as in SP2010, but that needs to be tested and verified.
 

Upgrade to SP2013, part 2: Clean up first!

I had a look at what Technet suggests as upgrade steps, and here is the table. I don't see anything about preparing your database for Claims authentication, as was so much spoken of at the conference. It will have to be a trial and error.
 
 
On my SP2010 test server, I have a restored copy of our intranet and I will use that to test upgrade to SP2013 so I get as a real scenario as possible. Will be interesting to see what happens with our branding and structure... :)
 
Before I moved the content database to the new SP 2013 server, I did a clean up on my SP2010 server. Better of not moving shit over if it can be resolved first.


Looked inside Health Analyzer, and of course there are some messages in there about farm accounts (you know what I mean, I am sure about that!) but there are also stuff that really matters like orphan items, missing server side dependencies etc. I had a message about orphan items in the database, so I just clicked on “Repair automatically” and refreshed and it was gone. For the "missing server side dependencies" it requires a bit more work!

I ran this powershell command to test the content databases:
Test-SPContentDatabase -name WSS_Content -webapplication https://intranet.xxxxx | out-file e:\upgrade\upgrade.txt -width 500
Got the following results from that:

Category  : MissingFeature
Error        : True
UpgradeBlocking : False
Message         : Database [xxx] has reference(s) to a missing feature: Id = [xxx], Name = [Weather Web Part], Description = [Displays the Weather], Install Location = [WeatherWebpart].
Remedy          : The feature with Id xxx is referenced in the database [xxx], but is not installed on the current farm. The missing feature may cause upgrade to fail. Please install any solution which contains the feature and restart upgrade if necessary.

Category      : MissingSetupFile
Error           : True
UpgradeBlocking : False
Message         : File [Features\Taxonomy_WebPart_Feature1 \Taxonomy_WebPart\Taxonomy_WebPart.webpart] is referenced [1] times in the database [xxx], but is not installed on the current farm. Please install any feature/solution which contains this file.
Remedy          : One or more setup files are referenced in the database [xxx], but are not installed on the current farm. Please install any feature or solution which contains these files.

Category        : MissingAssembly
Error           : True
UpgradeBlocking : False
Message         : Assembly [xxx.Eventhandler, Version=1.0.0.0, Culture=neutral, PublicKeyToken=xxx] is referenced in the database [xxx], but is not installed on the current farm. Please install any feature/solution which contains this assembly.
Remedy          : One or more assemblies are referenced in the database [xxx], but are not installed on the current farm. Please install any feature or solution which contains these assemblies.
Since the UpgradeBlocking status False on all of them, then I guess it’s no need to worry but I have tried to resolve most of these errors anyway to clean up the database. First thing is to check where a solution is added, and to do that just run this SQL query on your content db:

Select * from Webs where SiteId in (select SiteId from Features where FeatureId = 'guid')

And then I could go to that site and remove for instance webparts from the web part gallery that was no longer referenced. Removed them from both Recycle bin and Site collection recycle bin. Ran the test-spcontentdatabase cmdlet again and it was gone.

I also used FeatureAdmin2010 (amazing tool from Codeplex!) to search through the farm and removed the files that it suggested.

Upgrade to SP 2013, part 1: Hardware reqs (on test server)

And so let the fun begin! This will be a post with many parts, I begin with the easiest part... :)

After attending the awesome SharePoint Evolution Conference in London this April, I was so inspired to get started with SP2013 that I immediately put up a migration plan when I got back to the office. Although I had installed an SP2013 server a few months ago, I had not really had any time to test much. But now it's time!

So I had an "old" test server that I created a few months ago with the following installed. I run all on the same machine since it is my test server:
- Windows Server 2012
- SQL Server 2012
- SharePoint 2013 (no updates installed yet)

But the machine needed more juice, I could barely start it. As I had seen at the conference the least minimum reqs for a server is to have 8 GB RAM and I only had 4 (!) but I got 12 GB so now it's more responsive.

Minimum reqs according to Technet:

 
What I had on the server:


 
And what it was upgraded to:
 

 
 

Wednesday, April 10, 2013

InfoPath forms do not work with replication - Updated!

10 April update: That last version 5.1.7322.8 did not help solving this issue with InfoPath. It seems like the problem with templates has to do with forms that uses Data Connections. There is a new version 6 out that I have not installed yet, will come back with an update after that.

5 March: Awesome news! I got a mail from the vendor that the newest version will have a hotfix that will correct this issue. It will be released in a few weeks. Look forward to that, and will of course update this blog post if things go well.

This post is about enabling replication between servers using a replication software and the problems related to that. It works well for exchanging content, but when it comes to InfoPath there are some real problems. This is not yet solved so there will probably be a part 2 of this post.

I have published a lot of web forms (InfoPath forms services) on the intranet and when they start replicating they run into the problems listed below. Same thing happens to a list that you have customized, the customised form is lost so it looks like a regular list again. The replication vendor has no solution so far.

The error will run in circles because if you make an update on one server, that will replicate to the others and the errors will just keep on coming back. Here are the errors and why they happen.

Advanced settings are not replicated
The first time you set up replication on an InfoPath form and try to open a form on the site, it will load in InfoPath and not in the browser. That is because the “Advanced settings” of the library are not replicated. You need to go in to the library and set the “Open in browser” again and then you also have to open your form template and republish it:


Data connections are lost
When you have done this change, the form gives you a new message. Now the data connections can’t be accessed, since they have lost the connection to the secondary data sources:
 

So you have to go in and add those back again in the IP form template:



By this time, your form has start replicating and now all other target servers has gotten those same errors. So this will just keep on going around in circles.

So what I did was to stop replicating the “Content types” and it works HALFWAY. Because then another problem came up...

The xsn version of the form template changes
Of course when you have done a change locally on a template it will get a new version number. So now all versions of this template is not in sync. And the result of that is that the users get the below error message. If they click “OK” the form loads but still annoying:

 
I have the setting on my IP forms to “Automatically upgrade form version”, which is the default setting. If the user clicks on OK the form loads, but I don’t want that message! I compared versions of the form and on the source server we have version 1.0.0.1701 and on the target server we have 1.0.0.1709 and that is of course because I had to open the form and add the data sources and all the other steps I wrote about before, that were lost while replicating:




So I changed the version to be the same on both servers. And that helped. So now that message was gone. But this is only a temporary help, not a SOLUTION! Once a form is updated again, the problems will all come back. So I will test publishing a new template that has "Do nothing" instead of "Automatic update version" to see if that can help.

My hope now is that the vendor will deliver a solution for this soon, otherwise this is turning into a big EPIC FAIL.