dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.45k stars 796 forks source link

Start-DbaAzMigration #6838

Open potatoqualitee opened 4 years ago

potatoqualitee commented 4 years ago

No idea if this is even useful but Start-DbaAzMigration would be similar to Start-DbaMigration but it'd use bacpacs and just migrate whats supported (Databases and logins?) Also gotta test if you can create a db that doesn't exist yet.

Here's some code that I used for a single db

$bacpac = Export-DbaDacPackage -SqlInstance localhost -Database $dbname -Type Bacpac
$results = $bacpac | Publish-DbaDacPackage -Database $dbname -SqlInstance $aserver -Confirm:$false -Type Bacpac

sqlpackage is available on Linux, I could make it core compat too.

wsmelton commented 4 years ago

Yes, bacpac can be used on new Azure SQL DBA server to create new databases. That is the primary function of it in Azure.