SQL Server database data migration (replication)

Completely copy the database in one computer to another computer. Note that the original computer still needs to be used and do not check to delete (to prevent misuse, I have no experiment)

1. Right-click the database you need –> task –> separate.

Database separation refers to separating the database file from the database server instance, which is equivalent to closing the database.

After the database is detached, the application cannot connect to the database, and the database files can be accessed by other processes. Usually detached database is used to quickly migrate the database to another instance of SQLSERVER.

 

  

 2. Find the data folder of your sqlserver, and copy the two related files of the database you need to another computer.

Note here, you'd better put it in the data folder of sqlserver, and you may report an error if you put it in another place, because the read and write attributes of the folder and user permissions are different, anyway, it is very troublesome to modify.

  

3. Go to another computer, right click –> Attach –> select your mdf file, confirm, you’re done, the database is successfully imported.

Guess you like

Origin blog.csdn.net/Kevin_meta/article/details/129242717