简体   繁体   中英

How to Migrate TFS SQL Server 2014 DB to 2012

We are using TFS 2013 and SQL Server 2014. A client of ours is requesting the TFS project and also uses TFS 2013 but with SQL Server 2012. How can we go about migrating? Will a simple backup and restore work when downgrading from 2014 to 2012?

You CANNOT do this - you cannot attach/detach or backup/restore a database from a newer version (like 2014) of SQL Server down to an older version (SQL Server 2012) - the internal file structures are just too different to support backwards compatibility.

And no - setting the compatibility level to 110 (for SQL Server 2012) in SQL Server 2014 also doesn't help ; it will prevent your T-SQL code from using new SQL Server 2014 T-SQL features, but it does not change the internals of the database file in any way, shape or form.

You can either get around this problem by:

  • using the same version of SQL Server on all your machines - then you can easily backup/restore databases between instances

  • otherwise you can create the database scripts for both structure (tables, view, stored procedures etc.) and for contents (the actual data contained in the tables) either in SQL Server Management Studio ( Tasks > Generate Scripts ) or using a third-party tool

  • or you can use a third-party tool like Red-Gate's SQL Compare and SQL Data Compare to do "diffing" between your source and target, generate update scripts from those differences, and then execute those scripts on the target platform; this works across different SQL Server versions.

Update by @MrHinsh:

WARNING : While these options may work for your own database projects it will NOT work for TFS. Changing the Database schema, moving data, or editing the tables will BREAK TFS and will invalidate your support agreement with MSFT

Backup / restore isn't a viable approach here - no version of SQL Server knows what was changed in the database files' formats for the next version.

So copy database schema and data from 2014 to 2012 and pray it will work - chances are, it wouldn't. There should be an Import / Export wizard in SSMS, at least it was there before.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM