Moving a SQL Server database to a new server
Whenever I move a SQ开发者_运维知识库L Server database to a new server I always to a database backup and restore. I have seen a lot of people, especially DBA's who will to a detach / re-attach of the MDF file instead. What is the preferred method and why? I find a backup/restore to be safer, less likely hood of corruption.
I just did this. For our small databases, I did a backup/restore - just because I felt like it was 'safer'. However, when moving LARGE databases, it is so much faster to just detach, copy and attach. This beats having to do a (usually slow) backup, followed by a copy and a (usually slow) restore.
Microsoft recommends using alter database 'planned relocation procedure'.
Note, you can use attach/detach to upgrade between SQL versions as shown in the link.
精彩评论