12/21/2007

Renaming a Server Breaks SQL Server!

If you've not run across this one yet, you will one of these days. It's been around for a long time and is pretty easy to fix by rerunning Setup. How does your server get renamed?
  • The obvious answer: you did it! You renamed the server.
  • No so obvious: you installed SharePoint on a test server using local accounts and then decided to add Active Directory or join the server to a domain so you can play with all of the email features. (typical error code in the Event viewer is 17204)

Just Re-run Setup...

To fix it just rerun SQL Setup and let it repair the installation. But what about Microsoft Sql Server Embedded Edition (SSEE), the free, default and well hidden edition of SQL server that does not come with a setup program? Several Knowledgebase articles describe how to do this with a command line tool, but they never tell you enough. Here's one: http://support.microsoft.com/kb/929665 They show you this line: Msiexec CALLERID=OCSetup.exe REINSTALL=ALL REINSTALLMODE=omus /qn REBOOT=ReallySupress /l*v But they don't tell you the MSI_File_Name and it leaves out one switch. Here's one that worked for me: Msiexec /i "C:\Program Files\MSECache\wssv3\database\SSEE_10.msi" CALLERID=OCSetup.exe REINSTALL=ALL REINSTALLMODE=omus /qn REBOOT=ReallySupress /l*v c:\log.txt Note: If you are doing this to fix a SharePoint problem remember to run the SharePoint Products and Technologies Configuration Wizard to let it fix the internal database names. Some notes on SSEE:

  • Does not include any management tools, but you can connect to it using SQL Server Studio (regular or Express) with this "server name": \\.\pipe\mssql$microsoft##ssee\sql\query
  • It lives here: C:\WINDOWS\SYSMSI
  • The databases are here by default: C:\WINDOWS\SYSMSI\SSEE\MSSQL.2005\MSSQL\Data

12/08/2007

Which Conference or Event to Attend in 2008?

Too many choices! So little time and money... DevConnections? April 20-23 Orlando, FL 5 shows in 1! SharePoint Connections, ASP.Net Connections, SQL Server Connections, Architect Connections, Visual Studio & .Net Connections. http://www.devconnections.com/ Microsoft Office System developer conference? Feb 10-13 2008 San Jose, California https://microsoft.crgevents.com/ODC2008/ SharePoint Conference 2008 March 2-6 Seattle, Washington http://mssharepointconference.com Can't decide between Office Developer Conference 2008 vs. SharePoint Conference 2008? Check out this SharePoint Product Group blog SharePoint Information Worker Conference 2008 Feb 2-6 Nashville, TN http://sharepointsolutions.com/sharepoint-conferences/sharepoint-conference.html TechEd 2008 Orlando, FL Oh No! There are two of them this year! Tech·Ed U.S. 2008 Developers June 3-6, 2008 Tech·Ed U.S. IT Professionals June 10-13, 2008 http://www.microsoft.com/events/teched2007/default.mspx Microsoft Office Visio Conference 2008 Feburary 5-6 Redmond, WA http://www.msvisioconference.com/

12/05/2007

Replacement HTML Editor for SharePoint

You are probably aware that the rich text editor supplied with SharePoint does not work with non-Internet Explorer browsers and that there is a free replacement editor from www.telerik.com. If you need more features, then take a look at their "Full Featured" version. To see how it compares to the built-in editor and to see the differences between the free and paid versions see: http://www.telerik.com/documents/RadEditorMOSS_Feature_Comparison.pdf The following comments are about the free version... Positives:
  • Free! (The "lite" version anyway)
  • Works with most browsers, including FireFox, Netscape and with some limitations, Safari.
  • Has a search box, the Image Manager, to find pictures in SharePoint libraries. (this alone might be worth the upgrade) (only works with MOSS, not WSS)
  • Has a HyperLinks Properties panel with a Browse button to browse to any content in your site collection.
  • Includes a "Format Stripper" button to remove various formatting information included with Copy and Paste operations including Font, Word Formatting, All HTML and CSS.

Negatives:

  • Not out of the box SharePoint, and could be impacted by future SharePoint service packs and versions.
  • Does not work in SharePoint Basic Pages - these still include the built-in editor.
  • Does not work with "HTML Fields" and the Content Editor Web Part.
  • The default use will show the RadEditor in non-IE browsers and the built-in Editor in IE browsers. You can enable a second feature to display the RadEditor in both types of browsers.
  • Something else to add to your disaster recovery planning documention. (You do have this don't you?) You will have to reinstall after rebuilding a server.
  • It has to be turned on at the site level. So once installed it will have to be turned on for every site and sub-site. Their FAQ has the steps change the Feature to the Site Collection (web) level.
Are you using this editor? Please let me know how well it has worked for you and any issues, and fixes, you have found.

12/01/2007

Exploring SharePoint CMP Export Files

Exploring SharePoint CMP Export Files And how to restore a single file from the export!

The missing example project has been found! (see below)


This article started as a quick exploration of SharePoint site export files. Along the way I found a handy way to recover a single file from a CMP and even wrote a utility to both explore these files and to extract individual files from these CMPs. There are multiple strategies to back up SharePoint, SharePoint’s native backup (Central Admin and stsadm.exe backup), stsadm.exe's Site Export, SQL Server backups and third party products. As you are probably aware, there is no way to recover a single file from a SQL Server backup and Microsoft did not supply a means to extract a single file from a native SharePoint backup. One of the features of the third party tools is the ability to recover a single file, library or list item from their backup. Well it turns out that there is at least a reasonable easy to extract single files from SharePoint site exports.

The SharePoint CMP Export File
The SharePoint CMP backup file is a CAB file in disguise. Rename the .CMP file to .CAB and you can then explore the contents using Windows Explorer or extract it with extrac32.exe (C:\Windows\System32). Between the XML files and the DAT files SharePoint has recorded everything needed to recreate the site. Just an odd note... all of the files inside of the CAB file are date stamped "9/18/2002"!

Here is a sample export:

stsadm -o export -url http://yourservername/a_site -filename c:\a_sitebackup


The files in the CMP file include:

File
Contents
Notes
Manifest.xml The list of “everything” in the export
Lists, Libraries, ASPX files, Library files, etc
ExportSettings.xml
   
Requirements.xml
A list of “things” needed by the target server to support the exported site.
Language, site template, web parts and features
RootObjectMap.xml
The URL the site was backup up from
Example: Url="/SiteDirectory/walkthrough"
SystemData.xml
Top level details of the backup
SharePoint and database version numbers, manifest file name…
UserGroup.xml
Site users and groups
 
ViewFormsList.xml
A list of views and forms
(seems to be redundant as the same data is in Manifest.xml)
????????.dat
One DAT file for each file in the export
ASPX, Master, plus every file in document libraries and list attachments. Just rename and you have the original file

Restoring a Single File

(this is the manual approach… see below for a program to do it for you…) All of the files, including your library documents and every ASPX page in the site, are stored in the CMP file as sequentially named files starting with 00000001.dat. Each of these files is documented in the Manifest.xml file in their own SPObject node.

To find and extract a single file:
  1. Extract the Manifest.xml file:
    extrac32.exe backupfile.cmp /L outputPath manifest.xml /E /Y
    I.e. extrac32.exe C:\MySiteBackup.cmp /L C:\Temp manifest.xml /E /Y
  2. Open the Manifest file in Notepad of some other editor and then search for the filename. Keep searching until you find the element that includes the filename. In that element you will then find in the FileValue attribute the name of the file stored in the CMP file.
    Here’s what you might find:

    <File Url="Shared Documents/Walkthrough Presentation.pptx" Id="b089eb84-4bbd-4197-b14b-cdb9366f7b1c" ParentWebId="f41ba9ed-2298-45c4-a472-c166946776bc" ParentWebUrl="/SiteDirectory/walkthrough" Name="Walkthrough Presentation.pptx" ListItemIntId="1" ListId="bd6ac39c-8516-4f13-89d6-220a4b61d3e2" ParentId="eb24be0f-d49f-4e84-8b18-f8158bf47c63" TimeCreated="2006-09-08T02:41:09" TimeLastModified="2006-09-08T02:41:09" Version="1.0" FileValue="00000037.dat" Author="15" ModifiedBy="15">
      <Properties>
        <Property Name="vti_title" Type="String" Access="ReadWrite" Value="Walkthrough Presentation" />
        <Property Name="xd_Signature" Type="Boolean" Access="ReadWrite" Value="false" />
        <Property Name="ContentTypeId" Type="LongText" Access="ReadWrite" Value="0x0101002C9F3418595D5642A69D915990334521" />
        <Property Name="vti_parserversion" Type="String" Access="ReadOnly" Value="12.0.0.4518" />
        <Property Name="Slides" Type="Integer" Access="ReadWrite" Value="3" />
        <Property Name="vti_filetype" Type="String" Access="ReadWrite" Value="pptx" />
      </Properties>
    </File>

  3. Extract the file:
    extrac32.exe C:\MySiteBackup.cmp /L C:\Temp 00000037.dat /E /Y
  4. Rename the file and you are done! (from 000000037.dat to “Walkthrough Presentation.pptx”)
  5. If you need the metadata (custom columns) associated with the document then explore the section of the XML.
Restoring a List Items
List items are not stored as files. The full text of a list item is recorded in the XML. Simply follow the first two steps above to extract the Manifest file and then search for the list name or some text from the item. Look for a element with a URL (DirName) that matches your list.

Here’s a sample:

<ListItem FileUrl="Lists/Announcements/1_.000" DocType="File"

ParentFolderId="e893aa18-01a4-4e11-994f-7f58829154b5"

Id="31d6d1cc-86eb-4822-aad9-9d22b068641c"

ParentWebId="f41ba9ed-2298-45c4-a472-c166946776bc"

ParentListId="675b5d94-79a4-41a0-9714-819647b7b48b" Name="1_.000"

DirName="SiteDirectory/walkthrough/Lists/Announcements" IntId="1"

DocId="d1ad54e5-c884-465d-b80c-fea560ea3a37" Version="1.0"

ContentTypeId="0x010400ECBBB05350418B428CBF8BDE561A874B"

Author="1073741823" ModifiedBy="1073741823"

TimeLastModified="2006-09-08T00:26:59" TimeCreated="2006-09-08T00:26:59"

ModerationStatus="Approved">

  <Fields>

<Field Name="Title" Value="Get Started with Windows SharePoint Services!"

FieldId="fa564e0f-0c70-4ab9-b863-0177e6ddd247" />

<Field Name="_ModerationComments"

FieldId="34ad21eb-75bd-4544-8c73-0e08330291fe" />

<Field Name="File_x0020_Type"

FieldId="39360f11-34cf-4356-9945-25c44e68dade" />

<Field Name="Body" Value=""&lt;div class="ExternalClass0F1CE1F788734CE3A8682DBFA3F34E5F">Microsoft Windows SharePoint Services helps you to be more effective by connecting people, information, and documents. For information on getting started, see Help.</div>" FieldId="7662cd2c-f069-4dba-9e35-082cf976e170" />

<Field Name="Expires" Value="09/08/2006 00:26:57"

FieldId="6a09e75b-8d17-4698-94a8-371eda1af1ac" />

  </Fields>
</ListItem>

 


My SharePoint Export Explorer (and file extractor) Program

To help understand the Manifest file I wrote a small .Net program to list the SPObject elements and a handful of attributes from each one.

The first step is to open the CAB file and extract the Manifest.xml file. As I have always been amazed at the features found in the .Net libraries, I figured I would find a CAB extractor library in the Framework. Turns out there was one in the one of the Betas, there is not there now. (There is a Zip library!) So I ended up using the CAB extractor found in Windows, extrac32.exe. (For details type extrac32 /? at the command prompt.) So within the app I used System.Diagnostics.Process to run extrac32 to extract the files. The Manifest.xml file is then loaded into an XmlDocument object, parsed into a DataTable and then displayed in a GridView. I'll post a link the EXE and source shortly...

(What happened to the sample EXE and code? It was lost when my laptop crashed! I'll recreate it one day...)

It’s been found!  See here…


.

Note to spammers!

Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.