Friday, November 30, 2012

SharePoint Preview to RTM?

Hello world....we have a site collection with a custom master page & design that we migrated from SharePoint 2010 to SP2013 Preview.  Now that the RTM bits are available on MSDN, it's been on my list to get that site migrated over from Preview to RTM.  I did not find any doco stating this cannot be done, so fingers crossed, I tried it out.

My first try was to use the backup-spsite & restore-spsite cmdlets, to see if I could move the site from the Preview server to the RTM server.  While I was able to create the backup, when I tried to use the restore-spsite command, SharePoint came back with the not-helpful Unknown SPRequest error occurred. More information: 0x80070003 error...so no go!  The ULS logs didn't mave much in there, so I scrapped the site backup approach.

What did work was the content DB approach.  I took a SQL Server backup of the source database, which had only my site in it.  Make sure the content DB doesn't have a site with the same name as one in your target farm, including the root site, since that will interfere with the 'migration'.

Restore this database backup in SQL Server to your RTM SQL instance, or restore it to a different database name & new file names if you're using the same SQL Server. 

Next up is to use the test-spcontentdatabase command:

test-spcontentdatabase -name mydbname -webapplication http://myserver.myco.com

which will come back with a set of warnings for the database.  Scan through this to make sure none will block the upgrade.  If all goes well, mount that database!

mount-spcontentdatabase -name mydbname -webapplication http://myserver.myco.com

Once done, you'll be able to open the site on the RTM version.

Friday, August 10, 2012

Sharepoint 2013 apps: prompt for credentials

At last - I've finally been able to deploy my first app!  I am mainly focusing on SharePoint hosted app development, we'll get this nailed down first then explore the cloud model.  But for now, I'm using Visual Studio 2012 RC with the Office extensions, then when I go in to create my first app, all is well, the app gets deployed, then when I try to open the app I get prompted for credentials three times then the page comes up blank.

IIS shows a 401 error, which led me to think it was a permissions issue, tried going down that path without success.

My good friend M. told me the solution - had to disable the loopback adapter check in the registry on my box.  Do these steps then try out that app again - it'll work just fine!

  1. Run RegEdit as admin.  Locate and then click the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  2. Right click the node "Lsa", point to New, and then click DWORD
  3. Type in the name of the key as DisableLoopbackCheck, noting case, and then press enter.
  4. Right click the new DisableLoopbackCheck key, and then click Modify.
  5. In the Value data box, type 1, and then click OK.
  6. Quit the Registry Editor, and then reboot your server.

Next up will be to create an app that interacts with a SharePoint list.  I'll post code once that's working!

Steve

Wednesday, July 18, 2012

Creating a SharePoint 2013 App - set the App Domain

Hello world...I finally have my first SharePoint 2013 App deployed!!  It was an interesting road.  The answer is to very carefully follow the steps in this document from MSDN, in particular, to set up your App domain.

Like many of you, I first installed SharePoint 2013, then Visual Studio 2012 RC, then ran the web install to get the SharePoint 2013 development extensions added in.  So far so good!  I then started up Visual Studio, saw the new "Apps" entry in the Office/SharePoint templates for Visual Studio, and created a new project based on the "App for SharePoint 2013" project type.  Cool!

But, when I deployed my App, SharePoint came back with the error "Failed to install App for SharePoint" in Visual Studio's Error list.  The Output window didn't show much more than that.  When I looked in the ULS log for my App's project name, I found this helpful message:

An App domain must be configured prior to completing this operation

That got me thinking there must be more involved in setting up an App, so when all else fails, I decided to read the doco.  I know, crazy!!  But before creating an App, you need to configure a hosting 'domain' for your Apps.  This is for on-prem hosting, I'm sure for Office 365 there's a similar process just so your HelloApp app won't overwrite my HelloApp app.

The PowerShell command "set-SPAppDomain" did the trick.  Since the document says to also link this domain to the Subscription Settings and App Management service apps, I deleted both of these apps thru Central Admin, then used the referenced script to create them.  This does need the farm account, which in my case was already registered as a Managed Account.

$account = Get-SPManagedAccount "mydomain\myfarmaccount"
$appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account
$appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account
$appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name SettingsServiceApp –DatabaseName O13Preview_SettingsServiceDB
$proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $appSubSvc
$appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName O13Preview_AppServiceDB
$proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc

All that ran fine.

Interestingly, I had an error on this last step:

Set-SPAppSiteSubscriptionName -Name "mydomain" -Confirm:$false

Note that the name isn't the same name given in the set-spappdomain step - the above didn't like the period separator, so I used just the leftmost part of my domain.

The error, though, was another surprisingly clear error message.  PowerShell came back with an error from the SecureToken web service site (port 32843), checked to make sure the service was running, tried to delete the service app and recreate it but SharePoint wouldn't let me; looked in the logs again and there was the message:  " System.InsufficientMemoryException"

So that's clear enough!  My VM was running with 8GB of RAM - I had shut down some non-essential services like BCS, Word Automation, Visio, Access, etc., earlier, but looks like 8GB isn't enough.

After I increased RAM to 12GB I was able to do that last command, and finally I have a deployed app!!




Tuesday, July 17, 2012

SharePoint 2013 Hardware Requirements - RAM!

Time to beef up that laptop!  There's a posting on TechNet describing the minimum hardware footprint for SharePoint 2013: 

Of particular note is the RAM requirement - even for a developer box SP2013 wants 8GB of RAM.  A lot of the newer laptops go up to 32GB but my HP 8540w is maxed at 8GB.  I'm installing now using my usual two VM model, one for the AD & SQL Server box, the other for SharePoint.  Once done I'll post on performance, compared to the server running in our model office lab.

Monday, July 16, 2012

SharePoint 2013 preview released!

Got TechNet or MSDN?  Get downloading!!

I'm looking forward to all of the new capabilities of SharePoint!  Will be blogging details shortly.

Great info available on MSDN - the link to download the preview version, as well as some great training & docs on SP2013:

Friday, June 15, 2012

Hyper-V and Windows 8 and SharePoint, part 2

Still running Windows 8 and I'm growing to like it...but let's take a look at:

The Good
  • It's a 64 bit virtualization story from Microsoft, at long last!!
  • Uses the same file format as the Windows Server Hyper-V (VHD) and has an extended format that ran better for me - I converted my VHDs to VHDX's and performance did seem better
  • Works with both my wired and wireless network connections
  • Dynamic RAM allocation!

The Bad
  • No audio support in the virtual machine.  In theory if I use Remote Desktop Connection to log on instead of Hyper-V connect this would work, but so far I haven't been able to get it working.  Not that big a deal, I really don't need the audio on my servers.
  • No more Shared Folders...I miss this from VirtualPC/VirtualBox.  I can use regular ol network shares, but it's easier to just set it up with \\vboxsvr\c_drive!
  • Video resolutions are fixed - I can't resize the video window to whatever size I need, gotta pick from 1024x768, 1152x864, 1280x1024, or 1600x1200.  While these are acceptable, I'd like to be able to use more of the width & less of the height on my 1600x1200 monitor.

The Ugly
  • Can't have more than one hypervisor installed.  That is, I can't also install VirtualBox if I have the Hyper-V role installed - networking doesn't work but worse, the VM won't boot up.
  • Performance is not as good as VirtualBox.  It's acceptable, but I'll call this ugly because I want performance to be at least as good as VirtualBox.
  • Clipboard support.  This gets an ugly vote because there isn't an integrated clipboard between the guests and host.  There's a one way 'insert clipboard text' option available, but I can't copy text in the guest and paste in the host.  Maybe I do need to get Remote Desktop Connection working!

A few Windows 8 tips:
  • There was an update last Tuesday that really seemed to improve system stability - be sure you get those patches installed!
  • My AOC USB monitor does not work - don't use the DisplayLink driver!  Causes the display to not appear, and with Bitlocker installed I couldn't get to a system restore point :-(

Now, as for the rest of Windows 8, I don't really use the Metro stuff yet since my laptop doesn't have a touchscreen.  I've figured out how to make the 'start' work, and I don't mind it...and I'm a keyboard guy so Alt-F4 from the desktop brings up the Shutdown menu, again I can live with that.

Monday, May 14, 2012

Hyper-V and VirtualBox with Windows 8

Well, here I am posting this on my Windows 7 laptop...I ended up reverting back to Windows 7 after a not too successful run with Hyper-V on Windows 8.  I have a pretty decent laptop, 8GB of RAM & an older generation i7 CPU (2 core, 2 threads) and with Windows 7 it runs VirtualBox pretty well. 

I have my domain controller/SQL Server box on one VM, and my SharePoint dev environment on the other.  I also have a Windows 7 workstation as part of the internal network so I can do some single signon testing.  With VirtualBox I can have all three of these machines running at the same time with decent performance - two are on an eSata SSD & the other is on an internal fairly fast hard drive.

With Windows 8, the good news is if you've used the VHD file format for your virtual machines, you're in luck - with a bit of work on changing additions & a few reboots you can definitely use your VirtualBox VMs.  If you went with the VDI file format, you're not out of luck, you just need some patience - VirtualBox offers a method to clone your VDI files to the VHD format.  Good instructions for doing this here:  http://srackham.wordpress.com/cloning-and-copying-virtualbox-virtual-machines/.  It takes a while but in the end I did have a workable copy of my VDI file in VHD format, which Hyper-V on Windows 8 could handle.  Didn't try any VMWare image conversions, good luck with that!

But that's about as far as the happiness went...when I fired up the VMs performance was slow.  I moved the VHDs around so that I was running on an internal SATA II SSD, not a rocketship drive but still plenty fast.  Got the additions sorted out, but still no luck.  The kicker was on the Windows 7 workstation machine, the video driver seemed very slow - colors didn't look great & performance was poky.  Should have taken a screen capture, sorry about that! 

So for now the answer is, I liked what I saw - our corporate hypervisor solution is Hyper-V with System Center 2012's Virtual Machine Manager.  I took one of our prebuilt VHD files & it worked great, and I was able to use my VirtualBox VMs with Hyper-V.  Performance was just too slow for now - high hopes for the next release of Windows 8 & higher hopes for the RTM release, hope it comes soon!

Timer job - cannot uninstall, missing default public constructor

So the answer is yes, timer jobs do need a default constructor, even if there isn't a need to have one. When my colleague tried to deploy an update to a timer job after pulling out the constructor, he got the following message:

Uninstall-SPSolution: MyCo.MyTimerJob.JobDefinition cannot be deserialized because it does not have a public default constructor

Tried to uninstall through the SharePoint UI but had the same error.

The fix was to put the constructor back in the code, then take the DLL and GAC it onto the server. Use PowerShell for this or if you have permissions drop it into the c:\windows\assembly folder, then perform an IISReset for good measure. After that you can uninstall the solution and redeploy.

Sunday, March 04, 2012

Windows 8, VirtualBox & Hyper-V

How could I resist...don't tell Corporate IT, but I just spent the weekend installing Windows 8 on my HP 8540w workstation. The install went fine, ended up doing a clean install as the upgrade didn't complete for whatever domain policy reason. I'm mainly interested in Windows 8 because - FINALLY!!!! - Microsoft has a virtualization story for 64 bits. I started out using VirtualPC when I was doing SharePoint 2003 development - to be able to have a server running on my laptop with my own domain, being able to have multiple servers running to simulate my SharePoint production environments, priceless. Then along came SharePoint 2010 and so much for VirtualPC...like many others I had found out about VirtualBox & have become a fan - it's a great piece of software, has been running like a charm for me & my team, but darn it, my production servers are running Hyper-V and it would be nice to try it, but was I willing to install Server 2008 as my host OS? nah.... So here we are with Hyper-V now on Windows 8. I'm kind of hip deep in some development projects so I can't just switch over entirely to it yet, so I thought to install VirtualBox first, to be able to keep on working, then migrate over to Hyper-V. Problem #1...I couldn't enable video acceleration in VirtualBox. Yeah, not a big deal, but I went in to Control Panel & saw it was using the default Microsoft video driver as my graphics card driver. That wasn't going to work...so I installed the latest NVidia graphics driver from the HP 8540w Windows 7 drivers site and I'm good to go. Display looks MUCH nicer too, thank you very much. Problem #2...so I couldn't get to the VirtualBox properties System Acceleration tab - it was grayed out. Tried booting up the VPC & it kept rebooting. The machine settings were correct - IO APIC enabled, enough RAM, 2D video acceleration...but still wouldn't start up Windows. I know my laptop supports processor enhancements, but then thought to remove Hyper-V (Start / Run / appwiz.cpl) and removed Hyper-V....then the acceleration tab is enabled, and the VPC started up just fine. So for now, looks like only one virtualization technology at a time. Soon as my development project dust is done - or next weekend, whichever comes first - I'll get a new Hyper-V dev environment spun up, then it'll be all Hyper-V going forward. Hmm, let's see if I can take my VirtualBox VHD & import them into Hyper-V - be back in a bit!

Thursday, January 26, 2012

SharePoint 2010 - Access is Denied, and I'm Site Collection Owner!

Had an interesting one yesterday. I finally got around to clearing up those annoying warning messages about the Cache Super Reader account in my Windows Event Viewer logs on one of my servers. I used the stsadm command to set the property for both the Cache SuperReader and SuperUser accounts, good to go - or so I thought!

Came in the next morning to find the server still up, but no one able to access any site collections on the web application where I set those accounts! SharePoint came back with Access is Denied, even though it was all fine yesterday, and the users were set up as Site Collection Owner through Central Admin. The logs didn't show a whole lot, other than an issue with Kerberos and the Services account I'm using - odd.

Knowing the last thing I changed was that cache account, I double checked the values, ran the PowerShell script referenced in the very good article SharePointServerCachesPerformance.docx - highly recommended read! The issue for me turns out that those accounts weren't added correctly in the User Policy for the web application. I repeated this on a dev box this morning, and verified indeeed you have to make sure your User Policy settings are correct:
  1. Open SharePoint Central Admin
  2. Click on Application Management
  3. Click Manage web applications under Web Applications
  4. Select (single click) the web app having issues (or better yet do them all while you're here!)
  5. Click on the User Policy icon in the ribbon
  6. Click Add Users
  7. Click Next to select the zone, go with the default All Zones
  8. Enter in the account of your SuperReader user, and grant this account Full Read permissions, then click Finish.
  9. Repeat this for the SuperUser user, but grant this user Full Control.
  10. iisreset - and let those users log in!

Happy 2012!!