DATABASE MIGRATION WITH dbatools

We can use dbatools, which is a PowerShell tool with which we can do the migration on SQL Server instances, we can move databases from source to destination by using the below commands. As a prerequisite you need to install dbatools(https://dbatools.io/commands).If that particular object already exists in the destination server script will skip that particular object and will push remaining objects.

Start-DbaMigration -Source RAMESH -Destination RAMESH\TEST -BackupRestore -SharedPath "\\ramesh\Pradeep\"
 
Start-DbaMigration -Source RAMESH -Destination RAMESH\TEST -BackupRestore -NetworkShare "\\ramesh\Pradeep\" 

If we notice script here there are two parameters which are compulsory -SharedPath or -NeworkShare in some environments you can found -SharedPath parameter and some other environments you can find -Networkshare

Data and log files of databses would be stored in the default path of folders which would be created while we are installing SQL server.

Comments

Popular posts from this blog

System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out

Pre login Handshake or Connection Timeout Period

Transparent Data Encryption(TDE) with Master Key and Certificate in SQL Server