Restoring Sharepoint content database from backup

A small script to quickly restore a Sharepoint 2007 content database from backup:

USE master
GO

ALTER DATABASE SITE_WSS_Content
SET SINGLE_USER WITH
ROLLBACK AFTER 5
GO

RESTORE DATABASE SITE_WSS_Content
FROM DISK = 'path_to_backup\SITE_WSS_Content_backup_201201122000.bak'
WITH REPLACE
GO

ALTER DATABASE SITE_WSS_Content
SET MULTI_USER
GO
This entry was posted in Work and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *