Some months ago I was experimenting with Windows Sharepoint Services and found out that my machine was not powerfull enough to run Windows 2003, SQL Server and Sharepoint at a decent speed. I had data in Sharepoint I wanted to keep so I did an SQL Server backup of the database. I tought that I would re-setup everything easily after a machine upgrade… I was wrong! I never succeeded to restore the database backup in a running Sharepoint environment (I learned the hard way that I should have used WSS backup utilities instead of relying only on a database backup).
From that moment I decided to explore how Microsoft stores its data within Sharepoint. I found out about Docs and UserData tables and I thought I could develop a little tool to extract my data. In the mean time I discovered the Sharepoint Database Explorer from James Edelen. I was happy that I would’nt have to code it myself :)… The tool is nice, but it didn’t allow me to export custom lists and metadata…
As a learning experience, I decided to build an exporter program. It happens that I find it usefull in a couple of situations… So I decided to share in case anybody would have the same needs than I had!
***** Updated (2010-02-01) *****
- Export attachments with the same directory structure than original document library. Thanks to Amrit for providing the code.
***** Updated (2009-01-28) *****
- Bug fix regarding the extraction of document librarie items. Some files where not “seen” and not exported (thanks to Finn Olesen for discovering the problem)
***** Updated (2008-02-21) *****
- It is possible to preview the pending version (checked-out and saved, but not yet checked-in) of a file.
(on both: WSS 2.0 and WSS 3.0) (see this screenshot)
- Bug fix regarding the extraction of document librarie items when files are checked-out.
- Connects to either Sharepoint 2003 or Sharepoint 2007 database structure (automatic detection).
- It is possible to preview the version history of a file and to export individually a previous version of a file.
- Connects to Sharepoint 2003 databases directly
- Does not rely on a working Sharepoint environment… it only connects to the database
- You can preview the list contents (see screenshots)
- It is possible to export individual files from the preview window.
- You can export custom list attachments and document library files
- You can export metadata
Metadata is exported in an xml file. For attachments, you have the choice to export them in a folder or to embed them in the xml.
- When a list is not customized (kept as-is — no additional fields added), Microsoft does not store the column mapping (Sharepoint field name mapping to SQL Server column name). They probably store them in a resource file so its faster to retrieve than querying the database. For us, that means we have to hardcode the mapping for each list type (Custom List, Contact List, Discussion List, Calendar, etc.). For this reason, some list types may not export well.
- Preview tab – Attachment history
- Preview tab – Custom List
- Preview tab – Listitem with attachment
- Export tab
- XML sample
Download (Latest Version):
- Sharepoint Database Exporter (v184.108.40.206) – Binaries Only
- Sharepoint Database Exporter (v220.127.116.11) – Sources and Binaries
- License (New BSD License)
- XSL Transformation to convert output into an HTML Table
(use this to import to an older Excel spreadsheet that does not have native XML support)
Download (Previous Versions):
- Sharepoint Database Exporter (v18.104.22.168) – Binaries Only
- Sharepoint Database Exporter (v22.214.171.124) – Sources and Binaries
- Sharepoint Database Exporter (v126.96.36.199) – Binaries Only
- Sharepoint Database Exporter (v188.8.131.52) – Sources and Binaries
- Sharepoint Database Exporter (v184.108.40.206) – Binaries Only
- Sharepoint Database Exporter (v220.127.116.11) – Sources and Binaries
- Sharepoint 2007 Database Exporter – Alpha 1 – Binaries
- Sharepoint 2007 Database Exporter – Alpha 1 – Sources and Binaries
- Sharepoint 2003 – Database Exporter (v18.104.22.168) – Binaries Only
- Sharepoint 2003 – Database Exporter (v22.214.171.124) – Source and Binaries
This work is done on my free time, but I encourage to post bugs and feature requests so I can take a look when I’ll have time.
Also if you made your own modifications, feel free to post them back so I can integrate them, of course giving you the credits for what you’ve done…157 comments