Tuesday, December 08, 2009

Microsoft SharePoint Server 2010 Beta 2 – How to recover data from an unattached content and restore it to a (or another) site

A new feature in SharePoint 2010 is the ability to recover content from an unattached database (also tested to work for attached databases). The following are steps to do this (in case I forget in the future).
Note of warning: Screen shots and directions in this entry are based on SharePoint 2010 Beta (v. 14.0.4536.1000) and may change without notice.
I. Export from Database
1. Within Central Administration v4, browse to “Backup and Restore” section in the Quick Launch
image
2. Click “Recover data from an unattached content database”:
image
3. On the “Unattached Content Database Data Recovery” Page, enter the database server and database name of the source database to restore from, select “Browse content”, and click Next:
image
4. Select the Site Collection from the Database, the site from the database and the List as required, select “Export site or list”, and click Next (Note – this screen shot is based on a Beta version, and it appears that even though you have the correct site collection selected, the URL shows the central administration url. Only the relative URL is correct here):
image
5. Type in a file share location (ensure the SharePoint Farm account has owner access to this folder in Windows), and click Start Export:
image
6. Wait for the job to complete:
image
image
7. Files will be created in the share directory (Note: Contents of the .cmp file can be opened as a cab file – just like most other wsp packages):
image
II. Import to new Site
1. Open up the SharePoint 2010 Management Shell
image

2. Let’s assume we have already created a blank site to be restored to @ dougleung.com. We will now restore to that SharePoint Site:
Run this command in the Management Shell:
Import-SPWeb –Identity [url] –path [path]
eg. Import-SPWeb –Identity http://dougleung.com –path \\servername\folder\exportfile.cmp
image
3. Your contents from your export file (in this case the exported Announcements list) will be imported to the dougleung.com site.