Your Friend Prescan.exe - How to Get it & What it Does - Part 2
Between Shane's prescan post (view comments for more details), Bill's prescan wisdom and a few of my own, there are a few good posts on prescan.exe. I tried to do some digging today to address a question on got on my recent prescan post (part1) about what prescan actually DOES. Here's some info I gathered from Bill Baer, Ziyi (dev), and Liping (test).
First off, how do you get prescan? You may see posts where you have to install WSS or MOSS on a server to get the binary and/or XML. Here's a simple workaround. Thanks to the Burl and Samantha based on a thought in alpensh's post.
1. Download Prescan.exe by downloading the 32bit product you plan to upgrade to WSS 3.0/MOSS self extracting executable and run the following command (filename):
SharePoint.exe /extract: <path to file>
> sharepoint.exe /extract:c:\WSS3\
OfficeServer.exe /extract: <path to file>
> OfficeServer.exe /extract:c:\MOSS\
2. After you extract the files, navigate to <path>/Global/WSS/sts.cab, and find the prescan.exe file (and don't forget preupgradescanconfig.xml for SPS to MOSS).
3. Copy the prescan.exe file (and preupgradescanconfig.xml for SPS to MOSS) to a more convenient location on the SPS 2003/WSS 2.0 server with content to be upgraded and run it using the appropriate parameters (/all, /v <URL>).
Examples:
SPS 2003: prescan.exe /c preupgradescanconfig.xml /all
WSS 2.0: prescan.exe /all
/all for all sites or /v http://yourwebapp if you have custom site definitions, and well as you can point to your own /c upgrade schema .xml file.
If it goes well. You'll see "scan finished without failure" in the output. For more details see Part 1 for what success looks like and refer to Bill's blog for prescan errors and what to do with them.
TechNet has more on the usage and syntax of prescan for upgrade.
Run the pre-upgrade scan tool (Office SharePoint Server) (SPS to MOSS)
Run the pre-upgrade scan tool (Windows SharePoint Services) (WSS 2.0 to WSS 3.0)
Next, what prescan is looking for...
-
Customized site templates - You need to know which site templates have been customized for a particular site so you can verify the customizations again after the upgrade. Check out the site template upgrade kit for details on these.
-
Sites based on custom site definitions (if you don’t run the correct command for SPS 2003, you’ll see all your areas)
-
Unghosted pages - with URL so you know which sites to focus on (it won't fail if you have these, just report them.)
-
Orphaned objects Objects such as list items, lists, documents, Web sites, and site collections that have been orphaned. Correct these before upgrading.
-
Custom Web Parts Report the existence of custom Web Parts to the appropriate site administrator or developer before upgrading, to give the administrator or developer time to investigate.
-
Sites that are based on languages or that use controls that are not installed, note these will result in failures if you try to ignore.
First let me admit the list above is a pretty good list, but unfortunately it's not comprehensive, this is another reason why I don't recommend in place upgrades. You may think you know what's been done to your environment, but I say... don't do it... Don't assume you know what exactly been done to your environment, and even prescan only knows what it thinks may cause upgrade to fail. I wish I had a list of what prescan doesn't know what to look for... That's the killer list. As I come across these issues I'll share.
I know you've been warned before about touching the database. Here's a "read" SQL command to view what sites haven't been scanned...
“SELECT Sites.Id, Webs.FullUrl FROM Webs Join Sites ON Webs.SiteId = Sites.Id WHERE Webs.ParentWebId IS NULL AND Sites.Bitflags & 262144 <> 262144”
So what does Prescan Touch in the database?
1. Tp_fields column in the lists table to persist the list schema. This is to facilitate v2->v3 list upgrade
2. Bitflags column in the sites table to indicate a site collection has been scanned.
Flips the bitflags field in the sites table in the content database to 262144 if it is ready to be upgraded.
Snippet from Bill's blog:
- It parses and saves List definitions with the associated Lists. SharePoint Portal Server 2003 Service Pack 2 already incorporates this feature whenever a list is modified; however, this process should be completed for all Lists, so prescan calls the SharePoint Portal Server 2003 Service Pack 2 method to persist that data.
- PRESCAN.EXE will report on common issues that will result in a failed upgrade; therefore, running PRESCAN.EXE, addressing reported issues, and resolving those issues, and re-running PRESCAN.EXE to verify those fixes is a best practice when planning a Microsoft Office SharePoint Server 2007/Windows SharePoint Services 3.0 upgrade.
So, how can you use this information? If you are doing a gradual upgrade you can focus on those with the flipped bit. If you are doing a database migration/db attach, you can move all those without flipped bits to a common database, and database attach those with the correct bits flipped.