An outline way to script out an instance is:1. Script User Databases.select 'DECLARE @DS nvarchar(512);' + CHAR(13) + CHAR(10) + 'SET @DS = N''D:\ScriptOut\' + suser_sname(owner_sid) + '_backup.bak'';' + CHAR(13) + CHAR(10) + 'BACKUP DATABASE ' + suser_sname(owner_sid) + ' TO DISK = @DS' + CHAR(13) + CHAR(10) + 'WITH INIT, SKIP, CHECKSUM;' + CHAR(13) + CHAR(10) + 'RESTORE VERIFYONLY FROM DISK = @DS;' + CHAR(13) + CHAR(10) + 'GO' + CHAR(13) + CHAR(10)from sys.databaseswhere database_id > 4;
2. Script db ownersselect 'ALTER AUTHORIZATION ON DATABASE::' + suser_sname(owner_sid) + ';'from sys.databaseswhere database_id > 4;
3 Script Login Defaultsselect 'ALTER LOGIN ' + name + ' WITH DEFAULT_DATABASE = ' + default_database_name + ';'from sys.server_principalswhere type_desc like '%login' and default_database_name <> 'master';
4. Script LoginsIf using the Microsoft code:- make the DEFAULT_DATABASE = master for all logins.- the logins will have thier original SID (security ID). This means you do not have to be concerned about permissions.- get rid of any logins like sa.5. Script Restoresselect 'RESTORE DATABASE ' + suser_sname(owner_sid) + CHAR(13) + CHAR(10) + 'FROM DISK = N''D:\ScriptOut\' + suser_sname(owner_sid) + '_backup.bak'';' + CHAR(13) + CHAR(10) + 'WITH RECOVERY, REPLACE, CHECKSUM;' + CHAR(13) + CHAR(10) + 'GO' + CHAR(13) + CHAR(10) + 'USE ' + suser_sname(owner_sid) + CHAR(13) + CHAR(10) + 'GO' + CHAR(13) + CHAR(10) + 'DBCC checkdb;' + CHAR(13) + CHAR(10) + 'GO' + CHAR(13) + CHAR(10) + 'EXEC sp_updatestats;' + CHAR(13) + CHAR(10) + 'GO' + CHAR(13) + CHAR(10)from sys.databaseswhere database_id > 4;
6. Script Agent JobsProbably best just to do each one from Management Studio.If using Maintenace Plans I would not bother but re-create them in the new instance.You can then:1. Backup the DBs on the old instance2. Script Logins on new instance3. Restore DBs on new instance4. Script DB Owners on new instance. (ALTER AUTHORIZATION)5. Script default dbs for logins on new instance. (ALTER LOGIN)6. Script jobs on new instnace.If you are not used to scripting you should test the scripts in a Test instance.I always script out instances with something like the above before upgrading them.Just as well when I had problems upgrading a SQL2005 instance!(I eventually had to completly remove SQL Server including folders under Program Files and the registry tree)http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=190452I would strongly recommend a recent server image before starting!I have never had any problems upgrading SQL2008 to SQL2008R2 but it sounds as though something is not quite right with your setup.Good Luck!