Mar 13

Sharepoint 2003 and 2007 Database Exporter


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) *****

Features (v1.1.0.3):

  • Export attachments with the same directory structure than original document library. Thanks to Amrit for providing the code.

***** Updated (2009-01-28) *****

Features (v1.1.0.2):

  • 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) *****

Features (v1.1.0.1):

  • 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.

Features (v1.1.0.0):

  • 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.

Features (v1.0.0.1):

  • 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.

Known issues:

  • 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.


Download (Latest Version):


Download (Previous Versions):

Final Notes:

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 so far

  1. Pascal May 8th, 2007 9:04 am

    Version is now available. It contains a fix of a bug that was giving an error while exporting document libraries that contained sub-folders.

    My bad… I wanted to make to code cleaner before posting the first version to the site and I introduced a regression bug :(.

    A big thank you to Merijn Boom for reporting the bug and suggesting a fix.


  2. Peter May 28th, 2007 5:36 am

    I finded a problem with export attachements from lists in this version ( When I try save attachement from list I have error:

    System.Data.SqlClient.SqlException: Invalid column name ‘Content’. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
    at System.Data.SqlClient.SqlCommand.ExecuteScalar()
    at Sharepoint2003.DBExporter.Data.DatabaseConnector.ExecuteScalar(string statement)
    at Sharepoint2003.DBExporter.SP.SPDatabase.GetFileContent(StringdocumentId)
    at Sharepoint2003.DBExporter.UI.ExplorerForm.PreviewFileListSaveAsMenuItem_Click(Object sender, EventArgse)

  3. Pascal May 30th, 2007 1:13 pm

    This tool is built for Sharepoint 2003.

    This is the typical error when trying to connect to a Sharepoint 2007 database using this tool because Microsoft has changed its database structure.

    If you’re really using Sharepoint 2003, feel free to write back.


  4. Pascal June 12th, 2007 11:11 am

    I am currently working on a modified version for WSS 3.0. It is not ready to be published on this site yet. It currently works only for document libraries. But if any one is an urgent need, just drop me a message and I could send it by e-mail.

    You can expect to see it appear on my blog in the coming weeks, depending on how much interest I receive. It’s summer here and the sun is shining so I’m much more motivated to ride my bike than to sit in front of the laptop… ;)

  5. Pascal July 16th, 2007 8:47 am

    I have been asked a couple of time to send the version for WSS 3.0. For now, the development is stalled because I don’t have much time. All I have is a hacked version that is only able to export documents from document libraries (which is 99% of what is usually asked for).

    If you are in desperate needs of it, than here is the link of the Sharepoint 2007 Database Exporter ALPHA release:
    click here

    *** Edit: See main post — current release now supports both WSS 2.0 and WSS 3.0

    If it doesn’t work for you, or you need to export other types of lists, feel free to send me a comment and I’ll see what I can do.

    Note to Max: I tried to send it to you by e-mail, but I either mistype your address or you had a typo in it (it keeps bouncing). Unfortunately, I cannot verify because I’ve been to fast on the delete button :(.


  6. Max July 16th, 2007 12:42 pm


    Thanks for the link, I’m sure I probably typed something wrong.

    I tried the Alpha Exporter and it works great. No issues what so over. Pulled out about 800 documents totaling 500MB.

    You’d know better since you’ve worked on it, is it possible to extract the documents using the same folder structure that was on the site?

    If you have the source for this version, I can play with it in my spare time, but like you, there isn’t much of that.

    Great job on the program though. Saved our butts.

  7. Pascal July 16th, 2007 1:45 pm

    Well, I’m always happy to hear “success stories” about my little tool…

    I put the alpha version in a hurry and didn’t take the time to publish the source code yet. But I’ll do.

    For the directory structure, yes it could be possible to reproduce the same directory structure. I’ll put this in my todo list… It is still possible possible to “discover” the directory structure if you exported the metadata with the file. When exporting the metadata, the application generates an xml file containing the original location and its exported location. Based on the original location it would be possible to write a script to regenerate the directory tree…

  8. Nate July 17th, 2007 7:17 pm

    Thanks so much for posting the alpha. Saved our shop a large amount of recovery time after an unexpected db upgrade (caused by another app).

    Thanks for taking the time to work on this and for sharing!

  9. Andreas August 23rd, 2007 8:32 am

    The alpha works very well, did save us a lot of hastle after sharepoint services 3 simply did not do its job any more.

    Thanks a lot!

  10. Andy McNiece September 11th, 2007 9:52 am

    I would be very interest in the source for the WSS 3.0 binaries when they are available. I used the binaries with success.

  11. Blake Theiss September 21st, 2007 11:01 am

    Hey thanks for putting the time into this open source project… I used the 2007 alph version to grab the file… Really appreciate it…

  12. Kevin September 24th, 2007 11:50 am

    I urgently need to recover some deleted documents and associated metadata.

    Thanks to your fabulous tool, I now have an extract with attachments embedded in the xml file. Now for the silly question: How do I import this into SharePoint?

  13. Pascal September 24th, 2007 1:34 pm

    I’ll try to package it as soon as possible.

    I was planning to build an importer that would use the sharepoint API to upload the files and metadata. Unfortunatly, I had no time for that. I built custom programs for specific situations for a customer but I can’t release the code since they are the owners.

    What is your version of Sharepoint? I’ll see what I can do.


  14. Kevin September 24th, 2007 6:51 pm

    Appreciate your help. Not sure which version number is more relevant to you so here’s both. WSS 11.0.7969.0 IIS – WSS+SP2+KB924881.


  15. Pascal September 25th, 2007 8:19 am

    Ok that means you’re using WSS 2.0 (aka Sharepoint Services 2003). I was wondering if you were using the modified version for Sharepoint 2007.


  16. Dave October 15th, 2007 5:56 am


    Do you have any guidelines / instructions / apps for importing data into Office Sharepoint 2007 (latest patched version) after it’s been exported using your tool?

    Great app, btw…


  17. Pascal October 15th, 2007 1:03 pm

    Hi Dave,

    It depends what you want to import… All of the feedback I received (with 1 exception) was from people exporting files from document libraries with no special metadata attached to them. That is easy to import using the new Sharepoint environment (ex: Explorer view of a document library).

    Do you have metadata to import? If so, I’m currently working on an importer. I plan to build the core with no graphical user interface so it can be available sooner.


  18. Pascal October 16th, 2007 8:22 am

    For those who were interested into having the Sharepoint 2007 Database Exporter source code (for Alpha 1), I finally had the time to package the code and place it on this site for download: click here for source code
    This alpha version is, in fact, the version for 2003 patched to work on SP2007. In the next release, the database exporter will be able to export both SP2003 and SP2007.


  19. Tim November 12th, 2007 4:57 am

    This is a fantastic tool but just out of curiosity can you tweak it to allow export of specific pages? I’ve got a list on a production server where the EditForm.aspx and DispForm.aspx pages have suddenly stopped working if passed the “ID” parameter for the list item – if the parameter isn’t specified the pages load fine.

    Even Reset to Site Definition doesn’t work.

    My only hope seems to be to check these files as they are inside a backup…

  20. Tim November 13th, 2007 11:22 am


    This is a great utility!

    I don’t suppose you could possibly tweak it so that we can export pages and forms?

    I’m in desperate, desperate need of a utility that’ll pull the EditForm.aspx, DispForm.aspx and NewForm.aspx from a backup…

  21. Pascal November 13th, 2007 12:17 pm

    Tim: I think it is possible but I would need the version of Sharepoint you’re using.
    WSS 2 (2003)?
    WSS 3 (2007)?


  22. ALKIM YILMAZ January 25th, 2008 11:32 am

    You are great. I was in a big trouble in the past 3 weeks and your tool worked perfect. I’ ve just changed my table name AllUserData to UserData on the database and there is no modification except that. Thank you so much.

  23. Grace January 30th, 2008 8:54 am

    the export notifies : 7 records retrieved, exporting, completed.
    The folder remains empty. what is the extenssion of the file, is it a hidden file, or something else? Thanks

  24. Pascal January 30th, 2008 11:56 am

    In the export tab you choose how the metadata is exported (not exported or exported as xml) and how attachments are exported (not exported, embedded within the xml of metadata or as a separate file). Depending on the options, you may have to select a file name or a folder location.

    In most situations, people exports document libraries and are not interested by the metadata. So the common options are:
    Metadata export format = “none”
    Attachments export format = “linked file”
    Export to: c:\temp\myfiles

    There is nothing exported has “hidden”. The extension used for attachments is the same as the original file stored in Sharepoint.

    Is this answering your question?

  25. B. Huard February 5th, 2008 5:57 pm

    Cool utility but I have a case it does not cover. I had a need to extract a document that was checked out and user did an undo check out by error. The document was saved in the DB backup but the tool only extracts the last saved document in a check-in state.

  26. Pascal February 6th, 2008 7:36 am

    Interesting case… I remember that I explored the possibility of displaying (in the preview tab) the history of each file and it wouldn’t be hard.

    I may end-up with something to help you in a day or two.


  27. Pascal February 8th, 2008 11:22 pm

    Hi Bertrand,

    I just published a new version of the Sharepoint Database Exporter (v1.1.0.0) that may solve your problem.


  28. Pascal February 21st, 2008 11:46 pm


    I finally built a test environment so I can add the requested feature. Version does now support exporting checked-out file version on a WSS 2.0 and WSS 3.0 database version.


  29. Tim February 26th, 2008 1:24 pm


    Are you interested in adding command-line capabilities to this? It works well, actually I find it a bit faster and easier than the Edelen tool. I think directly accessing the db was a good move.

    For nightly exports, however, I’d like to automate it. In our company we are still using a giant network drive for all of our docs, so a few of us are trying out Sharepoint as an alternative but management is requiring us to still keep copies on our network drive. So an exporter that I can script to would be useful.

    Thanks for making this available,

  30. Jennifer April 1st, 2008 9:19 am

    Thank you so much for posting this. I spent hours trying to restore a file and had tried the Edelen tool, but recieved errors. This was so easy and quick to use!

  31. Mark April 1st, 2008 5:31 pm

    Any updates on getting the folder structure preserved? I appreciate your continued efforts with this tool.

  32. Pascal April 2nd, 2008 7:37 am

    Hi Mark,

    This feature seems to have slip out of my hands last time I did an update… I guess I’ll find some time to implement it within the next week.


  33. Pascal April 2nd, 2008 7:38 am

    Hi Tim

    I realized that I never answered your question…

    This tool is intended for last-chance data recovery. It is not meant to be part of a backup strategy because I cannot garanty 100% success result. The tool is extracting data from database that only Microsoft knows all the details.

    Based on its purpose, I don’t see much use of being converted to command-line. If you still wanna use it that way, it would be pretty easy to ask a developer to do it since the database access code is isolated from the user interface.


  34. Martn Hespe April 16th, 2008 7:34 am

    Hi Pascal,

    I was experimenting with your excellent tool. I have a MOSS 2007 DB that contains elements from a SPS 2003 migration. I think I only can view elements with your application that were loded to the WSS Content DB after the migration. Or at least were openend and saved after the migration. Is there a way to also get access to the “hidden” data? For example I can see/extract about 200 files (40 MB) but there must be data over 1.4 GB…

    Thanks for answering!

    Best regards,


  35. Pascal May 11th, 2008 7:42 am


    I never experienced this problem but I never tried for a database upgraded from SPS 2003 to MOSS 2007. Also, this tool was developed for WSS sites, were you trying to export portal data? (ex: data stored within areas)


  36. Patrick June 10th, 2008 11:25 am

    I appreciate your efforts as well, but would be interested in some method like Tim indicated above of somehow automating an extract. We too need to have the documents pulled from the database for users. If your tool can’t accomplish this does anyone know of a solution for having this done nightly?

  37. Pascal June 12th, 2008 9:23 am


    This tool is not intended to be used on a working environment since it is a “last resort” recovery tool. If Microsoft changes its internal structure it will stop working.

    I found a tool made by krichie ( that is able to import/export a document library from the command line. I didn’t check the source code and didn’t test it yet but I’m pretty sure it should answer your needs.

    krichie published the application with the source code here:


  38. Pascal June 12th, 2008 9:31 am

    As a side note, I will adapt my exporter to respect the original directory structure soon (as asked by Max before).

    When completed, the SPIEFolder tool from krichie (see previous comment) should allow to re-import documents into libraries of a working environment. That will greatly help recovering files.


  39. Gareth June 16th, 2008 4:42 am

    Awesome tool. Top marks. I’m current completely restoring a SharePoint 3.0 site as the stsadmin tool was not clear that I had to backup each top level site (I was converting from Windows Internal Database to SQL 2005)

    So, I was wondering – do you have any scripts or programs that can easily convert the XML code of the custom lists into a Excel Spreadsheet? I just wanted to check with you first before writing my own.

    Thanks in advance;

  40. Pascal June 16th, 2008 9:57 am

    Hi Gareth,

    If you use Microsoft Excel 2007 (and probably Excel 2003 will also work), you just have to open the xml file into Excel. If you have an older version, the easiest method is to convert the xml into an HTML Table or CSV file.

    I Added an “Add-on” section into this post with a link to an XSLT file that perform this transformation.


  41. Gareth June 16th, 2008 2:54 pm


    Oh ok couldnt be any easier – thanks alot for that – i’m running 2007 so it shouldnt be any issues. I wasnt looking at the problem from a simple enough approach ;)

    Thanks again,

  42. Gareth June 16th, 2008 10:38 pm

    Sorry, one last question although I think I already know the answer to this: Is there any way of preserving the Custom Views on the lists and/or any calculated fields?


  43. Pascal June 17th, 2008 9:26 am

    As you probably expected, currently there is no way to export the view definitions and formulas of calculated fields.


  44. Gareth June 17th, 2008 2:45 pm

    Thanks for that – I suspected as much. Irrespective your tool just saved me alot of trouble. Thanks a LOT.


  45. Sudha June 18th, 2008 4:22 am


    Have worked on developing the webparts in sharepoint 2003 and .net1.0?
    I have certain clarifications needed on this ..if u can help me it wud be gr8.


  46. Scotch July 10th, 2008 1:16 pm

    Thank you. You saved my life.. ;)

  47. Chris August 10th, 2008 3:35 pm

    Thanks for this, but I was hoping it could recover a CSS file in the Style Library. It exports only a listing of the files in the style library. Can you help?


  48. Pascal August 11th, 2008 2:53 pm

    You can choose to export a listing (meta data), the files (attachments) or both.

    In the export tab, choose:

    • Metadata export format: “XML”
      filename: [path to your xml file]
    • Attachments export format: “Linked file”
      Export to: [name of folder to export files to]

    Since you only want to recover a single file, you can “browse” to that file (in the Preview tab) and right-click on it to “save as” locally.
    (see this screenshot)

    Tell me if you succeed or if you still cannot recover your file.


  49. BobC September 3rd, 2008 11:43 am

    Does this app export all versions of a document?

  50. Pascal September 4th, 2008 7:49 am

    Yes this application is able to do it but only one by one.

    If your intention is to export a complete list/library with all the versions of a file, this application cannot do it currently. I find it interesting and I take note of the feature. That won’t be hard to implement.


  51. Oscar September 15th, 2008 4:35 am

    Hello, need your help.
    I have a shearepoint db with 76GB i tried to open it with the “Sharepoint database exporter” and it does, althoug it gives some errors in some folders. when it gets to the file 85528 shows an error: error (bad pag id) detected during read at offset 0x00000d502d0000 in filr c:\……xxx.mdf’
    at system data sqlclient.sqldata
    at sharepoint.db explorer.ui.explorer form.loadpreviewlist(listnode node)
    at sharepoint.db explorer.ui.explorer form._sitestreeview_after select (object sender.treeview event args e)

    What is the problem there are some files missing… how can i export the tree folders insteade of only the files.

    Please help.

  52. Pascal September 15th, 2008 4:59 am

    Looks like your database is corrupted, do you have a backup?

    To export all the files of a document library, just use the export tab instead of the preview tab. For now the tool can only export files (not directory) but if you also export metadata it would be possible to reconstruct a folder structure from metadata.

    Note: It is in my todo list to be able to export directory structure as well.


  53. Oscar September 15th, 2008 9:10 am


    I do not have a backup. This is it and i realy nead it…
    How can you tell that the db is corrupted?? can it be fixed? When do you preview to be able to export directory?

    Oscar Rocha

  54. Pascal September 15th, 2008 9:52 am

    I deduced your database is corrupted based on the error you received. This is a native SQL Server IO error. I suggest to do a google search and see what can be done to repair the database. Perhaps it is just a SQL Server index that is corrupted and recreating it would fix the issue (I am not a DBA).

    Right now you can export a whole document library using the export tab. I don’t know when I’ll have time to modify the program to be able to retain directory structure.


  55. Oscar September 15th, 2008 10:17 am

    the problem with the export document is that it exports the documents but if there are sevaral docs with the same name it replaces them.

    Oscar Rocha

  56. Pascal September 15th, 2008 10:55 am


    It should not reuse the same name. There is specific handling for that (and I just confirmed by verifying the code). If it does overwrite, than that’s a bug.

    What it does if it finds a file with the same name already exported: it appends a number next to the name.
    Example (myfile.txt):
    1st: myfile.txt
    2nd: myfile (2).txt
    3rd: myfile (3).txt

    When you export, you can export metadata. It will generate an xml file. From this file we can make the relationship between its original location (folder) and its exported name.

    I know it is not ideal and I will try to put up some time to make the necessary modification to retain directory structure as soon as I can.


  57. Finn Olesen December 15th, 2008 9:06 am

    When I try to find my data, it takes only a small part of them, not all of them, what can be wrong there.


  58. Pascal December 15th, 2008 9:50 am


    There may be multiple reasons. The first I see is because of unexpected data resulted in an error. Do you receive an error message? What type of list are you displaying? Document Library? Is happening to all of your lists? What version of Sharepoint are you using?


  59. Finn Olesen December 15th, 2008 9:59 am


    I am using a WSS 3, there is no errors messages. it is my Document libery “Shared Documents”

  60. Pascal December 15th, 2008 10:44 am

    If there is no error message, it may be unexpected data-handling resulting of records being excluded in a database table join, for example.

    Is this problem occuring from all document libraries you have on this installation? Why are you using the sharepoint exporter? because of an environment crash? if so perhaps there is a database corruption.

  61. eric December 15th, 2008 2:52 pm

    Thank you for sharing.

  62. Finn Olesen December 16th, 2008 3:19 am


    Yes I have a crash on the Wss it was the config database, If I am using the SQL Server management ST Express it can see all the datas under the dbo.AllDocs, but only some off them in “Sharepoint DBExporter” some of the data it can see in Sharepoint DBExporter is in the same lib. as the data it can not see. Hope it gives a sense, I do not really know how I can see the base is destroyed otherwise.

  63. Pascal December 16th, 2008 11:02 am

    It is quite difficult to diagnose without data sample or a way to reproduce the situation.

    Do you have a .NET software developer handy that could check with the Sharepoint DB Exporter source code? Or is it possible to have access to the problematic database (or a copy)?


  64. Finn Olesen December 17th, 2008 4:38 pm

    Hi. I can but a copy of the database on my webpage then you can get it from there.
    I can send you a email when it is on the site.
    so plz send my you Email.

  65. redevil December 23rd, 2008 10:45 pm

    hi, can any successor here tell me how to use these tool? i need to get back my content for my partially upgraded sharepoint database. i reinstall WSS 2.0 and 3.0 to use back the existing partially upgraded database but not success. now what i have with me is only the partially upgraded database because i didn’t make any backup copy of it before this.

  66. Andy January 5th, 2009 1:11 pm

    Thank you so much for this tool, you really really really really really really saved my butt!

  67. redevil January 5th, 2009 9:08 pm

    Hi, Andy. how you did it? any application needed? i need back my data urgently. pls help on this.

  68. Bala January 28th, 2009 4:38 pm

    Thank you very very much for this tool…..

  69. Mario January 30th, 2009 6:17 am

    Pascal, you’re my new best friend!! I somehow stumbled to your website looking for tool to help me and I already lost hope…

    Thank you very much!

  70. Mg Chit February 1st, 2009 10:19 pm

    Hi Pascal,

    I am losing my hope to restore WSS whole site to retrieve a single file that one of my colleagues overwritten.

    Your tool really help me to extract out the file from old database.

    Thanks a lot.

  71. stefan demetz February 6th, 2009 9:43 am

    Hi Pascal,

    It seems it doesn’t work on SQL Server 2008.


  72. Pascal February 6th, 2009 2:59 pm

    Hi Stefan,
    Unfortunately, I never tested it with SQL Server 2008. Can you tell me how it behaves? Do you receive an error message?


  73. Josh February 17th, 2009 4:14 pm

    Hi Pascal,

    This tool works really well for what I was looking for, the only question I have is if you have a simple way to filter what attachments you export based on something like created date?


  74. Pascal February 18th, 2009 10:26 pm

    Hi Josh,
    Sorry, I didn’t implemented a filter. I admit that it would be interesting on large libraries or lists.


  75. Matthew A. Schneider February 26th, 2009 12:25 pm

    How many times have I been saved via the Web by smarter more generous people than me?

    Thanks Pascal, you saved my job. ;)

    Best regards,


  76. Dipak Panchal March 3rd, 2009 2:17 am


    It saved my job and time too…

    Its very good tool. Nice work man…

  77. Josh Uddin March 12th, 2009 1:06 pm

    The tool from James Edelen didnt work so well for me, but this version worked a treat. Many thanks Pascal.

  78. Marcio April 9th, 2009 10:15 am

    Amazing, thanks a lot for sharing this tool!

  79. Susan April 16th, 2009 6:02 am

    This tools sounds good. Could you varify with me please if this can extract the user details out of sharepoint as well?
    I am talking
    name, lastname, username, email, and the listing of teamsites this person would have been given access to.

    if this tool cannot would you know what can?
    i appreciate your answer

  80. Pascal April 20th, 2009 7:54 am

    This tool cannot extract user details out of Sharepoint. That would be an interesting feature to add…

    I don’t know about a tool that does it. Is ist from a broken Sharepoint Environment or from a working environment. With some googling, it is probably possible to find one for the latter.


  81. Steven April 24th, 2009 3:06 am

    I encountered an error when trying to view and export the site template gallery of a MOSS 2007 site from a content database. The error is:
    “System.Data.SqlClient.SqlException: Ambiguous column name ‘tp_GUID’
    at System.Data.SqlClient.SqlCommand.ExecuteReader
    at Sharepoint.DBExporter UI.ExplorerForm.LoadPreviewList(ListNode node)
    at Sharepoint.DBExporter.UI.ExplorerForm.SitesTreeview_AfterSelect(Object sender, TreeViewEventArgs e)”

  82. Dylan April 24th, 2009 8:43 am

    Awesome! Thanks.

  83. Pascal April 24th, 2009 9:10 am


    Thanks for the information. I will try to take a look as soon as I can.


  84. Andhem May 11th, 2009 10:59 am

    Great tool!
    Also, for pulling data from a live sharepoint site, I’ve used this tool that worked well for me:

  85. Justin May 26th, 2009 12:14 pm

    Thanks much – You saved us a ton of time. Only one problem I notice; If your app lists a document as checked out (shows userid in Checked Out To field) it does not get exported. The hasAttachments field is true, but in the attachments list at the bottom there are no files listed. Thanks again.

  86. Peter Fine June 3rd, 2009 1:16 pm

    Awesome, awesome, awesome tool! Beautifully simple and worked like a charm for me in SP2007 R2! Nice work.

  87. Peter Fine June 3rd, 2009 1:33 pm

    Sorry, MOSS 2007 Sp1, not R2. ;)

  88. Alain Méreaux June 30th, 2009 7:39 am

    Great tool.
    You saved me hours of digging into WSS specifications.

  89. Sevgin August 14th, 2009 2:29 am

    Thank you very much
    You saved me.


  90. Gijs van Dam August 26th, 2009 12:46 pm

    Statues should be erected in honour of Pascal. He saved my live, and prevented doom and agony that I was certain to unleash on the world entire.

  91. Ayah helal September 17th, 2009 5:15 am

    Thanx Alot
    you saved me

  92. Hasan Rahman September 21st, 2009 6:53 am

    Hi Pascal,

    Great tool! I could even use it on a Windows 7 machine with SQL 2008.

  93. Jalal October 21st, 2009 7:10 pm

    Hi Pascal,

    Great tool, thanks a lot. This tool helped me go through a SharePoint database that was 3 years old.

  94. Rob Brown December 3rd, 2009 7:45 pm

    Hi Pascal,

    Thanks for the excelent tool! I was just wondering if it would be possible to add somthing in? At the moment when you export data from lists it extracts it to the root of the folder, I have a image library with 5000 pictures in different folders; subfolders etc and I was wondering if it was possible to add the subfolder creation in? (Had a look at source but went straight over my head!!)

    Thanks, Rob

  95. Pascal December 3rd, 2009 8:52 pm

    Hi Rob,

    I had this in my todo list as you are not the first one to ask for that. I am sure it wouldn’t be such a big deal. I can point out exactly where would be the fix if you want to. Otherwize, I will check if I can do something quick.


  96. Amrit December 29th, 2009 5:22 pm

    I edited the “LinkedAttachmentFormatter.cs” file to change the first line of “ExportAttachment” method as shown below:

    public void ExportAttachment(int attachmentNumber, string sourceFolder, string sourceFilename, byte[] content)
    //following changes made by Amrit to create folder structure
    string sPath = System.IO.Path.Combine(_AttachmentFolder, sourceFolder.Replace(‘/’,’\\’));
    sPath = System.IO.Path.Combine(sPath, sourceFilename);

  97. Pascal December 30th, 2009 7:41 pm

    Thanks Amrit, I will integrate your changes into the class and recompile a new version.

    Thanks again.

  98. Nick January 28th, 2010 5:57 pm

    Hi Pascal, Thanks for making this tool available.

    Have you had a chance to compile a version that restores directory structure? I’m in desperate need of restoring a large database and really need the directory structure in place.


  99. Pascal February 2nd, 2010 12:10 am

    Hi Nick,

    I have implemented the code provided by Amrit into version

    This version now export documents with the same directory structure as it was stored into the document library.

    All thanks to Amrit.


  100. Mark February 12th, 2010 6:59 pm


    I too would like to automate this tool. I got halfway, but once I get to exportmanager and the formaters, I get lost.

    I understand you think this is only a last resort tool, but for those of us still running 2003 this would be a great way to allow single file restores.

    I would be willing to pay for your time to implement this feature. Please email me.


    PS. This tool saved my butt a couple of years ago… thanks so much!

  101. Shashi April 5th, 2010 6:11 pm

    thank you pascal very much for the this handy tool.i am wondering is there any way we can grab all the version as well for each document.if you can upgrade tool into that level it is much help full
    thank you again

  102. JAVIER RAMIREZ April 13th, 2010 11:28 am

    you are a fuckin genius!!!!!

    thanks a lot!
    thanks a lot!
    thanks a lot!
    thanks a lot!

    you are a master in this!

    because an electric cut , the master db of my sql server turn down it didn’t answer , so i had to reinstal it and also sharepoint services 3, but i only had content db, and with your powerful app i got back all files of my fellows

  103. Pascal April 13th, 2010 2:29 pm

    Not a genius… a developer that got into a similar situation in the past. ;)

    I am happy that helped you.


  104. Oscar May 12th, 2010 8:12 am


    I’m a sharepoint newbie. I installed MOSS 2007 this morning. It works, front end work and administration panel too.
    I would try your SP Database Explorer.

    When I start it, it ask me SQL Server Name and Database name.

    I’m sure where to find these informations.
    On the sharepoint administratiion console I found that main database server is : SYRTOS-2\OfficeServers (SYRTOS-2 is the name of my test server), so I set the Sql Server Name with this value and I kept Database name empty.

    I have the error message :
    System.application.exception : This database structure is not recognized as a SharePoint 2003 or SharePoint 2007.

    I think I must set a value for “Database server”, but where could I found this value ?


  105. Oscar May 12th, 2010 8:16 am

    I found the solution. Database name is available through the site configuration panel.

    Thanks for this good work.


  106. Ushi June 3rd, 2010 7:20 pm

    Thanks Pascal for this tool. awesome tool, I have used this a few times to recover deleted files. Recently however, a need has come up to recover a delete file with all it’s version history and there are 60+ versions of this document. If you have been able to add the feature to restore all versions of a document in one shot, I would really appreciate it.

    Another think I would really like is to be able to grab the document, all its versions with the metadata from the backed up database and be able to restore it to a sharepoint document library in the current working database.

    Thanks for this cool solution.

  107. Pascal June 5th, 2010 2:42 pm

    Hi Ushi.

    When I first developped the exporter, I had the idea of building another software that is able to import external data into a live Sharepoint environment using the Sharepoint API. I never had the time to do it…

    About your first point, that’s a good idea to be able to export all revisions of a file at one time. I will take a look to see if I can do it.


  108. Ushi June 10th, 2010 10:50 am

    I found a workaround for restoring a document’s version history from a restored copy of the database directly into the destination database.

    I ran a SQL script to update the DocVersions table and this allowed the document versions to be restored with the metadata. Before running this script, I grabbed the Siteid and Id of the document which was going to be restored from the destination database’s docs table

    Hope this helps others as well.

  109. Scott K June 22nd, 2010 7:45 am

    You saved my bacon :) been looking at this database for weeks on and off trying to extract the docs after a migration fail to EBS you rock my friend :)

  110. Joe July 7th, 2010 4:27 pm

    Is this tool compatible with the default SSEE database installed by WSS 3.0?

    I have pulled both the database server name and the database name from the Central Administration tool, however I receive the following error:

    System.ApplicationException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (providers: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)
    at Sharepoint.DBExporter.ExecutionContext.Create(ConnectionDetails connectionDetails)
    at Sharepoint.DBExporter.Program.GetContextFromUser()

    Any help would be greatly appreciated,

    Thanks for your time,


  111. Pascal July 7th, 2010 8:12 pm

    This is a SQL Server connection error. It is not even able to connect to database. You probably did not enter proper connection information. Is it a named instance of SQL Server you are using? Does your database server allows remote connection?

    For version compatibility… Latest version I tested was Sharepoint 2007. I have heard that it is working on Sharepoint 2010 but I never tested it.


  112. Joe July 8th, 2010 7:40 am

    Thanks for the quick response,
    Within Central Admin’s Manage Content Database Settings I have the following values:

    Database Server:

    SQL Server Database Name:

    I have tried a combination of just ‘SERVERNAME’ with and without the ‘\Microsoft##SSEE’. I’ve also tried ‘WSS_Content’, ‘SQLExpress’, ect for the database name. I’ve tried all of the above with both authentication types with a known account with full admin rights. I’ve tried running this app on the server itself and remotely on my management workstation.

    I would really love to be able to utilize your tool, it would be the perfect fit for our environment. Are there any suggestions you may have where I may be going wrong?

    Thanks for your time,


  113. Pascal July 17th, 2010 12:42 pm

    Normally it should work. Did you try running the exporter from the same machine as SQL Server? Maybe remote connection is not enabled on your SQL Server.


  114. Joe July 28th, 2010 2:38 pm

    I was able to resolve the problem by using the following connection string to access the default SSEE database:

    SQL Servername:

    Looking forward to utilizing your app, many thanks for publishing it.

  115. Ken August 4th, 2010 3:10 pm


    Great tool! I didn’t think it was possible to go and look into the database to pull files, but wow! Then again, I’m not exactly an advanced MOSS administrator, either!

    I did have two questions though:
    #1: After we export the docs.xml (metadata) and attachment_docs.xml (linked file), HOW do we get it into our new server? I know it exports it, but if everything is listed in an XML file, I’m unsure of how to get the files into a document library and show metadata. Do you have a how-to on how to do this, or a quick rundown on what to do?

    #2: I keep getting the following error after it says “Export has been interrupted because of an error!”:
    “System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
    at System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)”, etc etc. It was a fairly long message that it gave, but I was unable to copy/paste, so I just typed that above :p

    Any ideas?

  116. Dan August 5th, 2010 9:43 am

    I can’t express fully how thankful I am (and my client) for the use of this utility! You have saved me countless hours attempting to repair a failed SharePoint server.

    Thank you for efforts and your willingness to make this available,


  117. Dave August 23rd, 2010 12:06 pm

    Great tool! Thanks very much. The only thing it is missing is a way to sort the columns to locate your data a bit easier.

  118. ij August 26th, 2010 9:53 am

    Looks like nice tool but i get this when i try to connect to my db.
    Any ideas? My Sharepoint site is working but i need get files out.

  119. Pascal September 14th, 2010 7:58 pm


    Are you sure the database is from Sharepoint 2003 or Sharepoint 2007? If so, are you sure you are specifying the right database?

    The application is looking for some tables in the database. Based on what it finds, it is able to determine the version of the content database (2003 or 2007). Looks like it is none of them.


  120. David September 21st, 2010 8:19 am

    This is ABSOLUTELY one of the best tools every created! Thank you so much for your time and efforts!

    I have a site collection that functions just fine, but when restored the site collection is “empty”, 404 errors, and only the settings.aspx is accessible. Once the Publishing feature is re-activated (for some reason will not happen when restored)no more 404, but all the doc libraries are gone.

    Your tool showed me that the database is housing them in a separate site collection (with the same name), but more importantly, I’m able to get the files back!

    Thanks again.

  121. Ian Nicholson September 23rd, 2010 10:01 am

    We are using an out of the box sbs2008 server.
    How can I find the SQL Server and Database Name to insert into the Database Selection Fields?

  122. SAS October 4th, 2010 3:56 pm

    Hi Great Tool, any chance of getting it to work with Sharepoint 2010 please?

    I had a crash and need to recover the documents from the database.


  123. Chris Dill October 7th, 2010 2:50 pm

    You can do what I do to find the server name. Start>All Programs>SQL 2005>SQL Management Studio Express.
    The database listed in the window that pops up is the name, if it is selected correctly. Mine is SBSMonitoring, which is where I mounted my recovery database containing backup sharepoint database. It might also be in windows internal database, which is something along the lines of:
    For the database name… once you connect to SQL MS instance expand databases, and the name of the one your working with is the one you enter in the gui of the program. Dont know if that makes sense, but you would have to tell me where the files are your trying to extract… live database? Backup? Restored? backup of a live database?

  124. Chris Dill October 7th, 2010 2:52 pm

    Now for my question. I would like to run your program, as a script/part of my daily backup routine. The arguements would always be the same: xx server yy database zz file location. I know nothing about scripting, though I do have a handly little batch file that I use to xcopy all my important stuff to a removable HDD. If anyone can help me please send me an email at

    Please remove the words nospam.

  125. venu October 8th, 2010 11:37 am

    is it possible add items to directly to content database
    in sharepoint 2010

  126. Chris Dill October 12th, 2010 2:19 pm

    I am sure you could reverse this program if you knew what you were doing, although format and metadata might be tough. I would advise working directly with database only when necessary, such as in a disaster recover situation. Databases generally don’t like to be manhandled.

    More at

  127. Jim Davis November 14th, 2010 12:44 pm

    Outstanding – you’re a genius! Thank you!!!!!

  128. Andreas November 25th, 2010 2:42 am

    Thanks a lot! This helps me solved my 3 days of headache. I was unable to restore SharePoint site after DC migration.

    Great job!

  129. Martin December 7th, 2010 8:32 am

    Ey thnx for this tool.

    only now i would like a function export all.

    can that be done?

    kind regards.

  130. Mark February 16th, 2011 10:59 am

    Thank you very much for allowing use of this tool. It exported all the files out of a version 2.0 Sharepoint quickly, saving tons of work and/or much expense.

    Best Regards,

  131. Olivier March 17th, 2011 2:19 pm

    Hi there.
    Thanks for this great tool.
    What is missing is the possibility to order the columns and the treeview. If you could add clickable column header to reorder would be just great! I presume for now it goes by ID…but just a guess.
    Appart from that, really great tool. Thanks for sharing it with the comunity.

  132. Ramu March 25th, 2011 6:19 am

    Hi pascal,
    The tool is working fine in moss/wss database. you are rock. I should refer this in my blog as well Frind.

    I have changed some modification which support sharepoint 2010 database document library only.


  133. Pascal March 30th, 2011 5:21 am


    thanks. What are the modifications? are you interested to share them?


  134. Faye June 24th, 2011 9:17 am

    I write from Switzerland.
    I find this site because I have problem with a sharepoint backup. This backup is a stsadm backup.
    I have many problems to recover this backup to sharepoint.
    This tool can help my to explore my backup file .dat?
    Can anyone help me whit the procedure (steps)?

    Many Thanks

  135. Pascal June 24th, 2011 4:27 pm

    No, this tool is meant to connect to a sql server database, it won’t help with your backup file.


  136. Faye June 29th, 2011 9:03 am

    Hi Pascal,
    thanks for the answer.
    bad luck for me :-(


  137. Zeynep July 13th, 2011 6:02 am

    Hi Pascal,

    Thank you for your tool.

    I used this tool and export all of documents these are in a SPS 2003 document library.

    Now I need table names and field names which have user name info “who delete files”.

    And can I find a deleted file using this tool in SPS 2003 document library?

    Can you help me?

    Thank you very much.

  138. Walter Castillo July 19th, 2011 9:47 am

    Hi, could be possible extract a site template from a content database with this tool?


  139. Dave Bergsma September 2nd, 2011 4:21 am

    Hi Pascal,

    Thank you. Thank you. Thank you. Thank you. Thank you. Thank you. I’ll stop now. Can’t thank you enough. Excellent tool.

    Best regards,

  140. Jon September 21st, 2011 9:28 am

    Thank you for this tool!! After 20 hours of work trying to attach an old content database to a new site with NO luck I ran across this. Documents exported and uploaded to new site in less than an hour.


  141. Bruno Goncalves October 13th, 2011 6:10 am

    Hello Pascal,

    I’m new to sharepoint and I have to export some documents and corresponding metadata(preferably in XML format) from some sharepoint libraries.

    Your tool seems perfect for the job, I just have one question:
    will it work on sharepoint 2010 and sql server 2008?

    thanks in advance.

  142. omri October 29th, 2011 4:34 pm

    i’m trying this tool on sharepoint 2010 foundation
    and i’m getting the following error

    please assist asap if possible, our server is gone


    System.Data.SqlClient.SqlException: Invalid object name ‘DocStreams’.

    at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

    at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

    at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)

    at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

    at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()

    at System.Data.SqlClient.SqlDataReader.get_MetaData()

    at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)

    at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)

    at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)

    at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)

    at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)

    at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)

    at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)

    at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

    at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

    at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)

    at Sharepoint.DBExporter.Data.DatabaseConnector.ExecuteDataSet(String statement, String tableName)

    at Sharepoint.DBExporter.SP.SPDatabase2007.GetListItemAttachmentsList(SPListDefinition list, Int32 itemID, Boolean includeContent)

    at Sharepoint.DBExporter.Export.ExportManager.Start(ISPDatabase sharepointDatabase, SPListDefinition list, IProgressNotifier notifier)

    at Sharepoint.DBExporter.UI.ExplorerForm._ExportButton_Click(Object sender, EventArgs e)

  143. Pascal October 29th, 2011 7:13 pm

    Hi, I never tested it on Sharepoint 2010. I had some feed back that it was working. SQL Server 2008 should not be a problem.

  144. Pascal October 29th, 2011 7:22 pm


    This tool has been tested on Sharepoint 2003 and 2007 databases. I never tested it on a Sharepoint 2010, although I had some report that it was working in the early days of this version. The error tells me that a table name in the database has probably changed or your not connecting to the right database. I am no more involved in Sharepoint Development and do not have a Sharepoint environment handy. That would require a lot of time for me to verify and test.


  145. omri October 30th, 2011 1:51 am

    hey, thanks alot for your quick respones
    well, thanks alot for this tool anyway
    we’ll try to figure how to access this crashed DB with microsoft..

  146. David November 4th, 2011 1:05 pm

    I just want to say what a great tool this was. I cannot find any other existing tools that can still support sharepoint 2.0 databases without crashing.

    Thank you and great work.

  147. Tin February 19th, 2012 9:05 pm

    Thanks you so much for your sharing . Thais is very useful for us .

  148. Amit March 30th, 2012 9:25 am

    Dear Pascal

    I have had to create a new Sharepoint 2007 site because the old one crashed due to a service pack update and I didn’t know how to recover it. So I just created a new one.
    I backed up the old mdf files though. All my data is in ShareWebDb. I think this is the one for shared documents, isn’t it? I am just a newbie.
    I have renamed this backed up file as ShareWebDb_old and copied it into the MSEE path. I have had to rename it because there is already a file called ShareWebDb in the MSEE folder.
    I tried the Alpha version of your software.

    For SQL Server name I entered \\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query

    For Database name I entered
    I get the error “Cannot open ShareWebDb_old. Login failed.”
    What am I doing wrong? Please help mate.



  149. Amit March 30th, 2012 9:26 am

    By the way I am on SBS 2008. I am pretty sure my version of Sharepoint is 2007. Is this the one that SBS comes with default?


  150. Pascal April 17th, 2012 9:34 pm


    First you should use the latest version which is Then your connection problem is the application is not able to connect to SQL Server. You must provide valid credentials. Try using SQL Server tools with the same credentials that you are giving to the exporter and you should get the same result.


  151. Amit April 19th, 2012 8:59 am


    yes you are right. I am logged in as the network admin on SBS 2008. But when I try to access the sharedwebdb using SQL Server Management Studio it gives me an access denied error. The same error that I get when I access it through the Exporter. I don’t know what to do really. I though being the network admin user I would have full access to any files.Obviously not!
    Will it help if I provide SQL Server authentication in the Exporter?

  152. Chris April 19th, 2012 5:28 pm

    Pascal (or anyone else),

    I have a tree that I’m running out of memory on when I click on it and let it process. There is a field in the db that includes a thumbnail – if I know the field name is there an easy way to tell it NOT to retrieve that field so it doesn’t take up too much memory?



  153. Nenad September 7th, 2012 6:00 am

    Thank you SO MUCH!

    All I needed was the data from old DB, and after 3 months of struggle and reinstallations and blood-sweat-tears I finally found this beautiful tool!!!


  154. Tim September 11th, 2012 11:49 am

    Nice work on this. End to a long and troubled day. THANKS!!!

  155. Joe February 19th, 2013 5:12 am

    I tested this on a sharepoint 2010 install. The tool connects, lists db and libraries and file but errors out when i select a doc. I suppose this is not SPS 2010 compatible. Do you plan to upgrade it to support SPS 2010?

  156. neil crook September 12th, 2013 4:42 am

    Hi – very impressed with this tool. However when using it against a recovered Sharepoint 2007 database it is dropping out when it comes to a folder path longer than 248 characters. Are there any updated versions available that handle this or would it be possible to write in something to write out an exception log and move on to the next file?

  157. James October 31st, 2014 7:32 am


    The tool works well on our SharePoint 2003 Database. I can see in the preview window all the document versions listed and can export each one manually but if I do an Export of the whole site document folder only the published version gets exported, not the -v20, -v21 versions. Am I doing something wrong in the settings? I am trying to export all the documents from a library including the individual historical versions.

Leave a comment