Tuesday, February 24, 2009

Backup / Restoring SharePoint 2007 Site from SQL Database

I got this excellent article on SharePointdogs for backup / restoring the SharePoint site from SQL DB :
http://sharepointdogs.wordpress.com/2008/07/30/content-migration-or-backuprestore-in-moss-2007/#comment-9
Here is one of defined approach which worked wonders for me :
USING SQL
Using SQL, Backup the SQL Content Databases which are required and Restore them to a new databases in the SQL and attach these databases to the new application.
(Briefly we can say that take your content db ‘Offline’ using the Central admin. Take the content database offline in SQL Studio (Take Offline context menu item). Copy your database mdf and ldf files to the new machine (the destination machine). Attach the copies on the new SQL server using SQL Studio. Add the copied content DB to the Web Application on the new machine using the Central Admin on the new web server.)
STEPS:
1)Find the content DatabaseThese are listed under Central Admin->Application Management->Site Collection List
2) Backup the content databaseYou could alternatively detach it, and copy it. Just doing a backup in SQL Server 2005 Management studio is easier.
3) Restore content database to new serverCopy the BAK file to new server. Create an empty DB in Management Studio, restore from backup, you may need to change an option in the “options” tabof the restore dialog to get it to work. (Overwrite db).
4) Create Web App on new ServerCentral Admin->Application Management->Create or extend Web App->Create New Web App.
5) Associate restored DB with new Web AppCentral Admin->Application Management->SharePoint Web Application Management->Content Databases->Remove Content Database from your new web app.
Now use STSADM to add restored DB to this web appc:\program files\common files\microsoft shared\web server extentions\12\bin on new server is where you can find the STSADM.run this command from there.
stsadm -o addcontentdb -url http://yourwebapp:port -databasename yourcontentdb -databaseserver yoursqlserver
6) Run ISSRESET from command prompt

No comments:

Post a Comment