Friday, March 23, 2012

install in customer server

Hello,

I'm looking for a script to export all reports from server A (include all folder tree/datasource and reports) to a file in order to import in server B ?

I'm looking the export and import scrip in order to install my reports in the customer server

(I'm using SQL 2005)

Thanks


There are some KB Articles see http://support.microsoft.com/default.aspx?scid=kb;en-us;842425 and some links in it...
Here is the way I do it:
-Install SQL Server + Reporting Services on the destination maschine.
-Export the ReportServer and ReportServerTempDB on source maschine via SQL Server Management Studio
-Export the key with the ReportServer-config tool.
-Run my bat-File (see below) on destination maschine

You have to adjust the bold parts!
For RSKeyMgmt key.snk is the file containing your key and report is the password.
The bat file should stop the specific services on Win2k and WinXP (maybe in Win2003), if you expierence problems stop SQL Server Reporting Services and WWW- Publishing manually before running the .bat file.
create a .bat file containing:
net stop "SQL Server Reporting Services (MSSQLSERVER)"
net stop "World Wide Web Publishing Service"
net stop "WWW-Publishing"
sqlcmd -i restore.sql
net start "World Wide Web Publishing Service"
net start "WWW-Publishing"
net start "SQL Server Reporting Services (MSSQLSERVER)"

RSConfig -c -s localhost -d ReportServer -a Windows
RSKeyMgmt -a -f key.snk -p report
create restore.sql containing:
/****** Drop Databases ******/

EXEC msdb.dbo.sp_delete_database_backuphistory @.database_name = N'ReportServerTempDB'
GO
USE [master]
GO
DROP DATABASE [ReportServerTempDB]
GO

EXEC msdb.dbo.sp_delete_database_backuphistory @.database_name = N'ReportServer'
GO
USE [master]
GO
DROP DATABASE [ReportServer]
GO

/****** Restore Databases ******/
RESTORE DATABASE [ReportServer] FROM
DISK = N'E:\Program Files\Microsoft SQL Server\Scripts\backup\ReportServer.bak' WITH FILE = 1,
/* Specify Source! Absolute pathnames */

MOVE N'ReportServer' TO N'E:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ReportServer.mdf',
MOVE N'ReportServer_log' TO N'E:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ReportServer_log.LDF',
/* if the installation is on a different drive you need to move the files */

NOUNLOAD, STATS = 10
GO


RESTORE DATABASE [ReportServerTempDB] FROM
DISK = N'E:\Program Files\Microsoft SQL Server\Scripts\backup\ReportServerTempDB.bak' WITH FILE = 1,
/* Specify Source! Absolute pathnames */

MOVE N'ReportServerTempDB' TO N'E:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ReportServerTempDB.mdf',
MOVE N'ReportServerTempDB_log' TO N'E:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\ReportServerTempDB_log.LDF',
/* if the installation is on a different drive you need to move the files */

NOUNLOAD, STATS = 10
GO



/****** Restore rights ******/
USE master
GO

DECLARE @.AccountName nvarchar(260)
SET @.AccountName = 'MASCHINENAME\ASPNET'

if not exists (select name from syslogins where name = @.AccountName and hasaccess = 1 and isntname = 1)
BEGIN
EXEC sp_grantlogin @.AccountName
END
GO

USE [ReportServer]
GO

DECLARE @.AccountName nvarchar(260)
SET @.AccountName = 'MASCHINENAME\ASPNET'

DECLARE @.name_in_db nvarchar(260)
select @.name_in_db = sysusers.name from sysusers inner join master.dbo.syslogins logins on logins.sid = sysusers.sid where logins.name = @.AccountName and logins.isntname = 1
if @.name_in_db IS NULL
BEGIN
EXEC sp_grantdbaccess @.AccountName, @.name_in_db OUTPUT
END
IF @.name_in_db IS NOT NULL AND @.name_in_db != 'dbo' AND @.name_in_db != 'sys'
BEGIN
EXEC sp_addrolemember 'RSExecRole', @.name_in_db
END
GO

USE [ReportServerTempDB]
GO

DECLARE @.AccountName nvarchar(260)
SET @.AccountName = 'MASCHINENAME\ASPNET'

DECLARE @.name_in_db nvarchar(260)
select @.name_in_db = sysusers.name from sysusers inner join master.dbo.syslogins logins on logins.sid = sysusers.sid where logins.name = @.AccountName and logins.isntname = 1
if @.name_in_db IS NULL
BEGIN
EXEC sp_grantdbaccess @.AccountName, @.name_in_db OUTPUT
END
IF @.name_in_db IS NOT NULL AND @.name_in_db != 'dbo' AND @.name_in_db != 'sys'
BEGIN
EXEC sp_addrolemember 'RSExecRole', @.name_in_db
END
GO

USE msdb
GO

DECLARE @.AccountName nvarchar(260)
SET @.AccountName = 'MASCHINENAME\ASPNET'

DECLARE @.name_in_db nvarchar(260)
select @.name_in_db = sysusers.name from sysusers inner join master.dbo.syslogins logins on logins.sid = sysusers.sid where logins.name = @.AccountName and logins.isntname = 1
if @.name_in_db IS NULL
BEGIN
EXEC sp_grantdbaccess @.AccountName, @.name_in_db OUTPUT
END
IF @.name_in_db IS NOT NULL AND @.name_in_db != 'dbo' AND @.name_in_db != 'sys'
BEGIN
EXEC sp_addrolemember 'RSExecRole', @.name_in_db
END
GO

USE master
GO

DECLARE @.AccountName nvarchar(260)
SET @.AccountName = 'MASCHINENAME\ASPNET'

DECLARE @.name_in_db nvarchar(260)
select @.name_in_db = sysusers.name from sysusers inner join master.dbo.syslogins logins on logins.sid = sysusers.sid where logins.name = @.AccountName and logins.isntname = 1
if @.name_in_db IS NULL
BEGIN
EXEC sp_grantdbaccess @.AccountName, @.name_in_db OUTPUT
END
IF @.name_in_db IS NOT NULL AND @.name_in_db != 'dbo' AND @.name_in_db != 'sys'
BEGIN
EXEC sp_addrolemember 'RSExecRole', @.name_in_db
END
GO

|||

Thanks for response

I'm looking just export the reports and import the report on the client machine (my client have other reports so I can't use the database recovery method

No comments:

Post a Comment