I'm moving from a SQL Server 2008 R2 instance to a SQL Server 2012 instance on a separate box. I want to restore msdb to get all my agent jobs and the like and I'm getting the following error:

Restore of database 'msdb' failed.
System.Data.SqlClient.SqlError: The backup of the system database on the device \\BackUps\NOFAULT2010_msdb_FULL_20121016_220006.bak cannot be restored because it was created by a different version of the server (10.50.1600) than this server (11.00.2100).

I would understand this if I was trying to go from 2012 to 2008 but this is new to me.

Anyway to get this to work? Or if not best way to transfer the agent jobs, users, blazi blah ?


2 Answers 2


If you were trying to restore a user database - this would restore alright. The problem is that this is a system database. The system databases are designed for the version of SQL they were intended to work in. In order for SQL Server 2008 R2 MSDB to work in SQL Server 2012, you'd have to have no features different between the two versions. Make sense?

The Short Answer To bring your jobs across, you'd script them out from the old server and apply the script on the new one. You can do this as simply as right clicking and scripting each job if you have a few. Or looking into a script with PowerShell or some other approach if you have a ton and don't want to one at a time.

To take the Logins you'd use the Sp_help_revlogin script I reference below and a script to copy server level roles and permissions from the old and copy them to the new..

Basically for 90% of what you'd bring across, I'm pretty sure the answer is "script it out" and then just apply that script on the new server and the logins, the jobs, etc. will all now live in the Master and MSDB databases designed for SQL Server 2012.

The slightly longer answer and a quick discussion on approaches to migration/upgrade

So if you are trying to transfer all of these objects to SQL Server 2012 you have two basic options on your approach.

  1. Do an in place upgrade. Upgrade your instance from SQL Server 2008 R2 to SQL Server 2012..

Pros - you get all that 'stuff' (agent jobs, linked servers, logins, alerts, operators, mail profile, etc.) and you don't have to copy objects around..

Cons - it can be a bit messy, it works fine nowadays and is supported but I am paranoid and like to know for sure that I have success and a quick rollback option (if issues on new server, just revert back to your old server during a migration. With an in place upgrade, it is much more, well, final).

You can start here for an in place upgrade.

  1. Migrate to a new server...

In this case you just flip the pros and cons from above.. The approach isn't that tough or strenuous. It just requires some good planning. Basically you:

  • On your old server, script out all of the objects you want to move according to the instructions and approach for each object type which can typically be found in Books Online (objects like Jobs, Linked Servers, SQL Agent Alerts, etc.)...

  • Use a tool like sp_help_revlogin to move your logins across and a script kind of like this to move the login permissions across..

  • Backup and restore your databases which already contain the in-DB users and permissions(I like doing this over detach attach because it helps preserve that rollback ability but I've seen and done this either way).. Change your compatibility mode if you are planning on supporting the DBs in 2012 mode and have tested them that way. Or keep them in 2008 mode if that was your plan.

  • Run those scripts for all of the objects like jobs, logins, etc. on the new server that you created above from the old server(good to do most of these after the DBs.. as logins will error on you if their databases that they default to aren't there or a T-SQL step in a job's database isn't there, etc.)

The other nice thing about this approach is you can do a trial run ahead of time during business hours.. Point a test or dev version of the app(s) used on that instance to the 2012 and see what breaks.. Fix it and test out your checklist, your rollback plan, etc. and do that prep for go live night.

  • I tested this procedure, but seems doesn't work from 2008R2 to 2017, the agent doesn't start because of missing a new procedure dbo.sp_sqlagent_update_agent_xps.
    – Noor
    Commented Oct 17, 2018 at 12:30

This is an old post, but I'd like to propose a different solution.

  1. On your Sql2012 system, restore a backup of the SQL2008 MSDB database, but give it a different name during the restore ('msdb_2008'). Also, be sure not to overwrite the original files. The restore process will upgrade the database version to SQL2012.

  2. Detach the MSDB_2008 database from your SQL2012 instance (but remember where the recovered files are!)

  3. Stop SQL Server service (SQL Agent will then stop as a result)

  4. Browse to the area where your original MSDB files are, and move them to a subfolder for safekeeping.

  5. Copy the MSDB_2008 database files to the path there the original MSDB files were, renaming them in the process to match the original MSDB files.

  6. Restart SQL Server.

  • Would this actually work? Have you performed this procedure successfully?
    – Tom V
    Commented Nov 17, 2015 at 20:01
  • I've done it while upgrading from a SQL 2005 SP3 server to a SQL 2005 SP4 server, and it worked nicely. I haven't thoroughly tested it, but all of my linked servers/job scheduled/mail setups transferred nicely. I would imagine making a bigger leap from SQL 2008 to SQL 2012 would work the same way, but I have not tested it. Commented Nov 17, 2015 at 20:42
  • 1
    Aside from being untested and most likely unsupported I don't think this is a good procedure to suggest
    – Tom V
    Commented Nov 19, 2015 at 19:40
  • 1
    2005 to 2005 is moving from same version to same version, even if different service packs. I would expect going from 2008 to 2012 to be much different and more complicated because it moves between 2 different versions. Commented Nov 19, 2015 at 19:42
  • Excellent point ypercube, and I agree with Tom V also. I was just relating something that I have tried and had success with. Commented Nov 20, 2015 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.