...
- Disable SQL Agent service to prevent backups and other scheduled jobs from interrupting
- Shrink databases + log
Shrinking is optional, but reducing database sizes will make backups smaller and faster. Do this for each database of significant size or interest.
Code Block language sql DBCC SHRINKFILE (N'logicalfilenamefordata' , 100) GO DBCC SHRINKFILE (N'logicalfilenameforlog' , 100) GO
- Backup all non-system databases
- Backup msdb
- Backup master
- Backup model
- Stash backups away for safety - eg: into a c:\backups folder
- Stop SQL Services via services.msc
- Uninstall SQL Server and associated components - Take note of installed features (so when install of x64 is done, we match features - eg: reporting services, et al). Note the databases in C:\Program Files (x86)\Microsoft SQL Server\MSSQL11.<instance name>\MSSQL will stay where they are - the new x64 SQL will still use these.
- Reboot
- Install SQL x64 - Make sure to set mixed mode authentication and provide the sa password. Also make sure you match the features from step 9.
- Reboot
- Restore system databases
- Put server into single user mode
- Stop SQL server agent
- Stop the SQL Service using services.msc
Using an elevated command prompt, start in single user mode
Code Block language sql CD C:\Program Files\Microsoft SQL Server\MSSQL11.<instance name>\MSSQL\Binn sqlservr.exe -m -s<instance name>
Restore Master database from backup by running SQLCMD.exe from an elevated command prompt
Code Block language sql CD C:\Program Files\Microsoft SQL Server\110\Tools\Binn SQLCMD.EXE -S .\<instance name> -U sa -P <sa password> 1>RESTORE DATABASE master FROM DISK = 'C:\backups\master.bak' WITH REPLACE 2>GO
- Copy model database + log (model.mdf and modellog.ldf) from new x64 folder back to old x86 folder - ie:
FROM
C:\Program Files\Microsoft SQL Server\MSSQL11.<instance name>\MSSQL\DATA
TO
C:\Program Files (x86)\Microsoft SQL Server\MSSQL11.<instance name>\MSSQL\DATA - Copy MSDB database + log (MSDBData.mdf and MSDBLog.ldf) from x64 back to old x86 folder - ie:
FROM
C:\Program Files\Microsoft SQL Server\MSSQL11.<instance name>\MSSQL\DATA
TO
C:\Program Files (x86)\Microsoft SQL Server\MSSQL11.<instance name>\MSSQL\DATA - Start SQL Service from services.msc, make sure SQL Agent stopped
- Login using Management Studio
- Right click msdb, choose properties - Options and change "Restrict Access" option to "SINGLE_USER"
Restore msdb using new query in management studio:
Code Block language sql USE master GO RESTORE DATABASE [msdb] FROM DISK = N'C:\backups\msdb.bak' WITH REPLACE GO
- msdb should automatically go back to "Restrict Access" option value of MULTI_USER when restored.
- Start SQL Agent using services.msc
- Put server into single user mode
- Verify applications
- Should be able to login to jiwa databases using the Jiwa application with no issues
- Other applications using other database should also work
- Verify SQL jobs (eg: backups) are present and enabled.
...