SharePoint: Exploring SharePoint CMP Export Files (and a demo application)


Nearly two years ago I wrote another blog on this topic and referred to a little application I had written to explore a CMP file that could also extract individual files from the CMP. Shortly after that, and before I could upload the app, the hard disk in my laptop died. I recovered most of the content of the drive, but had thought I had lost my Visual Studio directories. Guess what! I revisited that drive (I never throw things away…) looking for some old pictures and I found the missing app!


First go read the original article: Exploring SharePoint CMP Export Files. There you can see what’s in a CMP and how to manually extract the files.


To help understand the CMP 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 though!) So I ended up using the CAB extractor found in Windows, extrac32.exe. (For details type “extrac32 /? | more” 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.

The List Content button extracts the manifest.xml file from the CMP file and then extracts some of the descriptive content of the manifest file to display a fair amount of detail in the GridView. The manifest documents EVERYTHING about the site, so I added some checkboxes to filter the display.

  • Files Only – well… only displays manifest entries about files (including ASPX, master pages, and other non-content files)
  • Exclude ASPX – hides ASPX files (in the next update I’ll have it hide all non-content files)
  • Include List Items – I hid list content as a default as most of the interesting stuff is in the XML and is different for each list type. If you check this box then all list items are added to the grid. You can check scroll to the right and click in the XML column to see the full XML description of the list item.

Extract All Files extracts all of the files, then renames them and puts them into a SharePoint-like directory structure. Note that this example has three subsites in the backup.


The extracted files are where you would expect them to be, Shared Documents in this example, and still have their correct Date Modified:



Extract Selected extracts individual files to any location you pick. To select a file click the “selectors” at the left of each row. To select multiple files use the normal click, shift-click, ctrl-click techniques.




I will probably most this into CodePlex.com, but for now you can download it from here:

  EXE only:   download  (9k)

  Project zip:  download  (107k)




Anonymous said...

Brilliant!!!!! Thank you for this great tool. It saves a ,lot of time and pain restoring my sharepoint files!

Frank said...

This is a great app for acquiring content. Any ideas how to overcome the dat change on the exported documents? The date modified changes to March 23 2003 on the documents.

emilbloo said...

Frank, I am also struggling with the .dat change. Did you figure out how to overcome it?

Anonymous said...

I tried your tool today. Almost worked perfectly. I had to add this to the source code to make it work:
case "File":
row["FileValue"] = fileNode.Attributes.GetNamedItem("FileValue").InnerText;
catch { }

home.aspx did not have a filevalue attribute so it excepted with a Not set to an instance of an object.

Als, use the c:\temp folder as it cannot handle long directory structures or the code has to be altered to do use quotes aroung c:\program files\this is my directory"
Other than that it work nice to recover the file I needed

Anonymous said...

THANK YOU. I was able to recover the file I needed.

Charles said...
This comment has been removed by the author.
Anonymous said...

Mike, with this tool you really saved my day! I have a dying Sharepoint server here and needed to get out all data but didn't want to use WebDAV for some reasons. It worked like a charm to create a backup with stsadm and then extract the files with your tool.
Many thanks and cheers from Germany, Alex.

Rüdiger Patzke said...

great job, Mike ...
but unfortunately the program seems not to work with cmp-files from Exchange 2013 ...

I'm unable to restore the files ;(
Seems like the files didn't get extracted successfully because the error occurs while renaming the file.

Any hints for me?

regards, Rico

Mike Smith said...


This was only tested with, and intended to be used with, SharePoint CMP files. I don't work with Exchange and can't offer any help there.


Rüdiger Patzke said...

Sry ... my fault ... ;)

Not Exchange 2013 ;)
SharePoint 2013 Foundation !

But the problem is gone ;)
Don't know why extraction failed yesterday.
Today all worked perfectly.

Thx, Mike for this great tool.
Made me getting a full backup of our different libraries separately without any issues ;)



Rüdiger Patzke said...

Sry ... back again ;(

Did same procedure with another DocLib.
Got some more files like:

by opening mydocs.cmp and list the items i got the content from the last successfully restored DocLib ...

thought, it was due to the "old" manifest.xml in the temp-folder ...
so i deleted the old one ...

After a fresh restart of SharePoint Backup Explorer i tried to open mydocs.cmp again.
But clicking "List Items" gave me : "Could not open C:\Temp\SharePointBackupExplorer\manifest.xml"
So it wasn't extracted?

Found the manifest.xml in mydocs8.cmp and extracted it to C:\Temp\SharePointBackupExplorer\manifest.xml and tried again ...
Unsuccessfully ... not all files were found ...

Do I need to "merge" the cmp-files manually to one file ?!

Hopefully awaiting an idea ;)



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.