Author: Tobias Zimmergren
http://www.zimmergren.net | http://www.tozit.com | @zimmergren
Introduction
Recently someone asked me about how to attack the major pain of upgrading their custom coded projects and solution from SharePoint 2010 to SharePoint 2013. Given that question and my experiences thus far I’ll try to pinpoint the most important things to consider when upgrading. There’s TONS of things you need to consider, but we’ll touch on the most fundamental things to consider just to get up and running. After that I’m sure you’ll bump into a few more issues, and then you’re on your way ;-)
Keep your developer tools updated
Visual Studio 2012 Update 1
The first step is to make sure that you’re running the latest version of Visual Studio 2012. As of this writing that means you should be running Visual Studio 2012 and then apply the Visual Studio 2012 Update 1 pack (vsupdate_KB2707250.exe) if it isn’t installed on your system already.
Download Visual Studio 2012 Update 1 here: http://tz.nu/Y28FCd
Visual Studio 2012 Office Developer Tools
The second step is to make sure you’ve got the latest developer tools for SharePoint installed. The package comes as an update in the Web Platform Installer which I urge you to have installed on your dev-box if you for some reason don’t already have it installed.
So, launch the Web Platform Installer and make a quick search for “SharePoint” and you should see the new developer tools there (note that the release date is 2013-02-26, which is the release date for the RTM tools):
![]()
Select the “Microsoft Office Developer Tools for Visual Studio 2012” and click “Add“. It will ask you to install a bunch of prerequisites which you should accept if you want to continue:
![]()
Let the tools be installed and the components updated. This could take anywhere from a few seconds to a few Microsoft minutes. It took about 5 minutes on my current development environment, so that wasn’t too bad.
![]()
Once the tools are installed, you are ready to get going with your upgrade.
Open your projects/solutions after upgrading Visual Studio 2012 with the latest tools
When the tools have been successfully installed and you open your solution the new tools will be in effect. If you’re opening a SharePoint 2010 project that you wish to upgrade to SharePoint 2013, you’ll get a dialog saying “Do you want to upgrade to a SharePoint 2013 solution? Once the upgrade is complete, the solution can’t be deployed to SharePoint 2010. Do you want to continue?”
![]()
Hit Yes if you get this dialog. If you want to upgrade your project to SharePoint 2013.
Once the project is loaded and have made all the necessary changes to the project files (which it now does automatically, unlike in the beta/preview tools where we had to do some manual tweaks), you should get an upgrade report telling you how things went. Hopefully there’ll be no Errors, only warnings and Messages.
![]()
If you check out the assembly references in your project that are pointing to any SharePoint assemblies, note that they have automatically been updated to the correct version of the SharePoint 2013 assembly:
![]()
Additional notes
If you upgraded without the latest version of the developer tools you only had the option to launch your projects in 2013-mode if you manually went into the .csproj file to modify (or add if one of them were missing) the following two lines:
v4.5 15.0
This was true when the developer tools were in Preview/beta. But now when they’re released to RTM you shouldn’t be doing those manual hacks anymore. Trust the tools!
Tip: Some general code updates that may be required
When you deploy artifacts to the SharePointRoot folder in SharePoint 2013 they are now deployed to the /15 folder instead of the older /14 folder. SharePoint 2013 has a much better support for upgrade scenarios than previous versions of SharePoint (2010) which is why we’ve got the double hives. So, if you want to properly upgrade your solution you should also make sure to replace all the paths in your project from:
Path to the Images folder
From the images folder:
/_layouts/images/
To
/_layouts/15/images/
Path to the layouts folder
Make sure to not forget the general layouts path:
/_layouts/
To:
/_layouts/15/
Path to the ControlTemplates folder
Also make sure to replace the following paths:
/_controltemplates/
To:
/_controltemplates/15/
Well you get the general idea here.. Should you find paths pointing to your old 14-hive instead of the new 15-folder, make sure to change the path/url.
Tool-tip
As always, you will not be an efficient developer without the proper tools at hand to make the daily tasks easier.
If you enjoyed using CKS Dev for SharePoint 2010 development, you’ll still be able to enjoy some of that awesomeness by simply installing the CKS Dev tools for SharePoint 2010 on your Visual Studio 2012/SP2013 box. They seem to work fine on Visual Studio 2012 as well – so until there’s a proper update of the tools, you’ll be able to knacker some of your code with the old tools.
Do note that there’s certain features of the CKS Dev that doesn’t work fully, so should you encounter issues with the tool in various scenarios that’ll most likely be because they’re not engineered for Visual Studio 2012 (yet).
Deploy-time
After you’ve done enough tinkering you’ll be ready to rock this baby up on SharePoint 2013.
Enjoy!
Comments are closed
Archived comments
nice!!
Thank you Nicklas.
Hej Tobias!
Great overview! Also think about replacing SPUtility.GetGenericSetupPath in your code, as it is obsolete in 2013. The new method to use is SPUtility.GetVersionedGenericSetupPath http://matte.in/XB2m58
//Matthias
Hi Matthias,
Thanks.
Sure there's tons of things that has changed in the API's as well, not only that path. I've bumped into tons of obsolete methods when migrating - but oftentimes there's a newer method to utilize which we can quickly resort to - just like with the one you just mentioned :-)
/ tob
Hi Tobias,
just tested that again for correct code generation in the SharePoint Software Factory ( http://matte.in/SPSF2012 ) and realized that images are not in /_layouts/images/15 , but in /_layouts/15/images
Also you might want to add that links to language specific resources need to be fixed too i.e. _layouts/15/1033/images
//Matthias
Hi Matthias,
Cheers - updated.
Yep, essentially anything going into the SharePoint root needs to be corrected with a new path. Shouldn't be too hard to figure out the path for all other resources, but perhaps I should make a list of all resources in the hive and list them, should anyone feel the need to look it up.
Tob.
Nice post Tobias - thanks. I also had a stab at this subject, but I was using Visual Studio 2010 still : http://www.collaboris.com/b...
Hi Mark, thanks.
Good post there, there's tons to consider - this is just a scratch on the surface :-)
Oh blimey I have lost many hours on this stuff. We have the added complication that we need so support 2007, 2010 and 2013 from one code base. Wrote a long post on that.
Lost many hours, or gained a lot of experience in troubleshooting - what's the difference ;-)
Jokes aside though, it can be a pain to do upgrades but my experiences thus far are pretty good. Not too many hickups yet.
Just migraded a 22-project large SharePoint 2010 solution to 2013 without much problems. Now of course, the fun part of testing, verifying and troubleshooting begins ;-)
Thanks a lot for this post! The only thing I still had to adjust afterwards was to set the SharePoint Product Version to 15.0 in the Package properties. (otherwise my files were set to the 14 hive). I'm not sure why the upgrade didn't change this and may have been a project specific issue.
Hi Caroline,
I'm glad you got it up and running - the new and upgraded tools are doing a lot of the work for us in terms of configuring the properties. In my cases I haven't had to change the product version either, but looks like it may be necessary in some cases.
Cheers,
Tobias.
Hi Tobias,
Thank you for this post. Initiated by it we added several rules to SharePoint Code Analysis Framework (SPCAF) to check all files in WSPs (.dll. .xml, .aspx, .master, .css, .xslt, .js...) for compatibility to SP 2013.
See here a list of all applied rules: http://go.spcaf.com/10Fh1mX
Maybe you could try the analysis after your migration and check your code for completeness. Get the tool here: http://go.spcaf.com/VSGallery
Any feedback is welcome.
Cheers,
Torsten
Thanks Torsten.
Looks great - I'll give it a whirl!
Tob.
Excellent post Tobias! Maybe you could help me with something. I had a 2010 solution that has a WCF service using the CKS template (the one that uses the factory and no extra XML): http://ranaictiu-technicalb...
Problem is when I migrated to 2013, the wcf is broken. It can't find the [BasicHttpBindingServiceMetadataExchangeEndpoint] attribute that used to be in Microsoft.SharePoint.Client.Services (there's no Services namespace now). Any idea of where that class could have been moved? Or which changes do I need to make to fix the WCF service?
Here's the issue in more detail: http://sharepoint.stackexch...
Thank you!
Hi Tobias
We have upgraded a visual studio 2010 solution to visual studio 2010..however, each time we open the solution by double clicking the solution file, the upgrade log files are getting generated each time in the solution folder.
Is the solution not upgraded successfully ? What is going wrong here ?
Small typo here :)
We have upgraded a visual studio 2010 solution to ** visual studio 2012
LinkBack
http://www.bondbyte.com/Blo...
I want to keep my codebase same for sharepoint 2013 and sharepoint 2010 solution. Sharepoint 2013 requires version 4. but 2010 supports 3.5 max. So how can do I do this? Do I need to use separate set of sharepoint dlls or I can use same set of dlls (ver14) with both?
Hi Guest,
You should really head on over to Marks blog here and check out an article he wrote on the topic: http://www.collaboris.com/b...
Cheers,
Tobias.
HI Tobias,i followed your step while upgrading from sharepoint 2010 to 2013 . we have bunch of custom solutions(which has custom layouts,many custom webpart and custom user controls,custom masterpages) and all goes good now. your steps are really helpful for us to complete our upgrade without any issues.Thankyou.
Rooba
Hi Rooba,
Thank you for the comment - I'm glad you could upgrade without hassle.
Tobias.
Thanks for the nice article. It helped me convert my two SP 2010 codeplex projects to SP 2013: http://sharepointnadeem.blo...
Hi Nadeem,
Thank you for the comment - glad it helped :-)
Tobias.
I followed the steps but still I am not getting any migration message while opening sharepoint 2010 project.
Did you open the project in Visual Studio 2012/2013?
Microsoft Minutes. Loved that!!!
Glad you liked it. After so many years with Microsoft tech, you learn that some things never change ;-)
Great advice, helped a lot.
One additional thing to do if you want things deployed in the 15 Hive is to change the SharePointVersion=”15.0″ in the package.xml, as I found here: http://www.learningsharepoi...
Not easy to find, you need to open the package in VS and then manually edit the generated manifest. Well at least that worked and helped me to migrate some Codeplex code.
will these steps work for Sharepoint 2007 custom solution migrate to Sharepoint 2013 as well.
@Zimmergren:disqus you are rocking!!! Very informative article. Its a gem for me.
Hi, Rocky.
Appreciate the comment; Cheers, and glad you've found it useful :-)
Tobias.
Thank you so much for this article. Really cleared up a lot of things :)
Thanks for your comment, Nabeel. I appreciate it :-)
Tobias.
Hey brother, I need some help. Any way I could contact you. Its regarding a migration issue I have encountered
I would suggest you post it on stackoverflow or the MSDN forums for SharePoint in order to get some assistance. There's plenty of helpful people :-)
Thanks
Tobias.
Yeah, but you are a European influencer ;)
I knew someone was lurking around the corner!
Hope you're doing well Mark. May I please ask you to direct any questions to MSDN or SO? ;-)
Tata.
Tobi.
Tobias Zimmergen, i need some help. Is there a way I can contact you ?