Upgrades can be a titanic pain and a platform with as many moving parts as SharePoint means you’re in for a lot of headaches.
If you’re upgrading Office or even Windows, it’s usually just a matter of sticking a DVD in your machine, hitting OK a few times and going for a coffee.
The first problem with upgrading to SharePoint 2010 is its requirements: it has to be on Windows Server 2008 64-bit, so you may find yourself upgrading the OS in the first place.
I’ve got a good idea!
Because of this, the upgrade task seems like a good opportunity to upgrade your hardware as well. For example, we moved our two farms onto a single, virtualised farm.
The trouble starts at the planning stage. If you’re moving from an old farm to a new one, you’re not upgrading you’re migrating and pretty much all the support out there is for upgrades.
Two Paths to Follow
SharePoint 2010 gives you two options for upgrading, a database attach upgrade or an in-place upgrade. We’re doing a database attach because upgrading production servers (which are a mess) into the unknown sounds like a lot of weekends spent in the office.
With a database attach upgrade you backup a content database from your 2007 farm, move it to your new database, create a receiver web application on your target farm and then go into Powershell to mount the new database into the app you just made. This grands away for a while, after which you have your old website on your new server. Great! It can even look the same, as you can pull the 2007 masterpages along, or you can elect to upgrade the ‘user experience’ during the database attach.
And then the Trouble Began
So this is all good (as long as you don’t have any custom code, solutions or files on the old farm that aren’t on the new farm) as long as you’re happy with the new farm where it is, as it is.
We have two 2007 farms, one for intranet and one for extranet. We’re merging them and redesigning the main site, along with lots of other changes, so we’re moving sites and lists out of the upgraded web application into a new application/site collection.
Now, within a single site collection you can use the Content and Structure tool to move sites, lists and items about. But if you want to move something between site collections, let alone web applications, it’s a bit trickier.
Powershell to the Rescue
If you can’t do Powershell, you can’t manage SharePoint 2010, it just can’t be done. Now, there should be a command to move a site or list, right? Something like Move-SPWeb or some such?
I’m afraid not. You can get some fancy-pants software to do that but it costs an arm and a leg, one testicle and a handfull of teeth. Particularly if you have a lot of material to move or lots of servers in your farm. Plus you have to install proprietary APIs.
So you have to use Powershell, specifically, the Export-SPWeb and Import-SPWeb functions.
The Import/Export Obstacle Course
Here’s the first problem: you can’t just import into an empty URL. You have to create a site on your target site collection, then perform the import. OK, that’s not a problem, I’ll just create a blank site and import into that.
Experienced SharePoint administrators will immediately see a problem with that. The site you create to import your material into has to be the same site template as the one you’re exporting from. As a bonus, you can’t tell beforehand what template a site was made with (can anyone correct me on this?) Luckily the import function will tell you what template you need in the error message. God help you if your original site was some crazy template that doesn’t exist on your new farm.
The other irritant is that you end up with a bunch of blank and duplicate lists. I hate clutter in SharePoint so it’s a fair bit of work to clean this up.
If my only Tool was Hammer
Being a lazy soul, if I find myself doing something more than once I’ll look for a way to automate it. It’s lucky I work with computers hey? Since I’m punching all these commands into the Powershell console, I may as well just save them to a file. That’s what’s done and it seems to work OK now. I shall post the completed script in my next post.