Tuesday, April 13, 2010

Backup script for TFS 2008 databases

Change the location of the backups before running the script.

BACKUP DATABASE [ReportServer] TO  DISK = N'E:\New Folder\ReportServer.bak' WITH NOFORMAT, NOINIT,  NAME = N'ReportServer-Full Database Backup', SKIP, NOREWIND, NOUNLOAD,  STATS = 10
GO

BACKUP DATABASE [ReportServerTempDB] TO DISK = N'E:\New Folder\ReportServerTempDB.bak' WITH NOFORMAT, NOINIT, NAME = N'ReportServerTempDB-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO

BACKUP DATABASE [TfsActivityLogging] TO DISK = N'E:\New Folder\TfsActivityLogging.bak' WITH NOFORMAT, NOINIT, NAME = N'TfsActivityLogging-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO

BACKUP DATABASE [TfsBuild] TO DISK = N'E:\New Folder\TfsBuild.bak' WITH NOFORMAT, NOINIT, NAME = N'TfsBuild-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO

BACKUP DATABASE [TfsIntegration] TO DISK = N'E:\New Folder\TfsIntegration.bak' WITH NOFORMAT, NOINIT, NAME = N'TfsIntegration-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO

BACKUP DATABASE [TfsVersionControl] TO DISK = N'E:\New Folder\TfsVersionControl.bak' WITH NOFORMAT, NOINIT, NAME = N'TfsVersionControl-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO

BACKUP DATABASE [TfsWarehouse] TO DISK = N'E:\New Folder\TfsWarehouse.bak' WITH NOFORMAT, NOINIT, NAME = N'TfsWarehouse-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO

BACKUP DATABASE [TfsWorkItemTracking] TO DISK = N'E:\New Folder\TfsWorkItemTracking.bak' WITH NOFORMAT, NOINIT, NAME = N'TfsWorkItemTracking-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO

BACKUP DATABASE [TfsWorkItemTrackingAttachments] TO DISK = N'E:\New Folder\TfsWorkItemTrackingAttachments.bak' WITH NOFORMAT, NOINIT, NAME = N'TfsWorkItemTrackingAttachments-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO

BACKUP DATABASE [WSS_AdminContent] TO DISK = N'E:\New Folder\WSS_AdminContent.bak' WITH NOFORMAT, NOINIT, NAME = N'WSS_AdminContent-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO

BACKUP DATABASE [WSS_Config] TO DISK = N'E:\New Folder\WSS_Config.bak' WITH NOFORMAT, NOINIT, NAME = N'WSS_Config-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO

BACKUP DATABASE [WSS_Content] TO DISK = N'E:\New Folder\WSS_Content.bak' WITH NOFORMAT, NOINIT, NAME = N'WSS_Content-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO

No comments:

Post a Comment

Remember, if you want me to respond to your comment, then you need to use a Google/OpenID account to leave the comment.