Thor Logo dbatools

Migration

Export-DbaDbTableData

Chrissy LeMaire (@cl), netnerds.net

Export-DbaDbTableData View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Generates INSERT statements from table data for migration and deployment scripts Description Creates executable INSERT statements from existing table data, making it easy to move data between SQL Server instances or environments. This is particularly useful for migrating reference tables, lookup data, or configuration tables where you need the actual data values rather than just the table structure. The generated scripts include proper USE database context and can be saved to files or piped to other commands for further processing.

Read more

Export-DbaScript

Chrissy LeMaire (@cl), netnerds.net

Export-DbaScript View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Generates T-SQL CREATE scripts from SQL Server Management Objects for migration and deployment Description Takes any SQL Server Management Object from dbatools commands and converts it into executable T-SQL CREATE scripts using SMO scripting. This lets you script out database objects like tables, jobs, logins, stored procedures, and more for migration between environments or backup purposes. The function handles proper formatting with batch separators and supports custom scripting options to control what gets included in the output.

Read more

Get-DbaBinaryFileTable

Chrissy LeMaire (@cl), netnerds.net

Get-DbaBinaryFileTable View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Identifies tables containing binary columns and their associated filename columns for file extraction operations. Description Scans database tables to find those containing binary data columns (binary, varbinary, image) and automatically identifies potential filename columns for file extraction workflows. This function is essential when you need to extract files that have been stored as BLOBs in SQL Server tables but aren’t sure which tables contain binary data or how the filenames are stored.

Read more

Get-DbaRgClassifierFunction

Alessandro Alpi (@suxstellino), alessandroalpi.blog

Get-DbaRgClassifierFunction View Source Alessandro Alpi (@suxstellino), alessandroalpi.blog Windows, Linux, macOS Synopsis Retrieves the Resource Governor classifier function configured for workload group assignment Description Retrieves the custom classifier function that Resource Governor uses to determine which workload group incoming connections are assigned to. The classifier function contains the business logic that evaluates connection properties (like login name, application name, or host name) and returns the appropriate workload group name. This function is always stored in the master database and is essential for understanding how Resource Governor categorizes and manages SQL Server workloads.

Read more

Import-DbaBinaryFile

Chrissy LeMaire (@cl), netnerds.net

Import-DbaBinaryFile View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Loads binary files from the filesystem into SQL Server database tables Description Reads binary files from disk and stores them in SQL Server tables with binary, varbinary, or image columns. This is useful for storing documents, images, executables, or any file type directly in the database for archival, content management, or application integration scenarios. The command automatically detects the appropriate columns for storing file data - it looks for binary-type columns (binary, varbinary, image) for the file contents and columns containing “name” for the filename.

Read more

Start-DbaMigration

Chrissy LeMaire (@cl), netnerds.net

Start-DbaMigration View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Migrates entire SQL Server instances including all databases, logins, server configuration, and server objects from source to destination servers. Description Start-DbaMigration consolidates most of the migration tools in dbatools into one command for complete instance migrations. This function serves as an “easy button” when you need to move an entire SQL Server instance to new hardware, perform version upgrades, or consolidate servers.

Read more

Sync-DbaLoginPermission

Chrissy LeMaire (@cl), netnerds.net

Sync-DbaLoginPermission View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Synchronizes login permissions and role memberships between SQL Server instances. Description Syncs comprehensive login security settings from a source to destination SQL Server instance, ensuring logins have consistent permissions across environments. This function only modifies permissions for existing logins - it will not create or drop logins themselves. The sync process handles server roles (sysadmin, bulkadmin, etc.), server-level permissions (Connect SQL, View any database, etc.

Read more

Test-DbaMigrationConstraint

Claudio Silva (@ClaudioESSilva)

Test-DbaMigrationConstraint View Source Claudio Silva (@ClaudioESSilva) Windows, Linux, macOS Synopsis Validates database migration compatibility between SQL Server instances by checking for edition-specific features. Description Prevents migration failures by identifying databases that use features incompatible with the destination SQL Server edition. This function queries sys.dm_db_persisted_sku_features to detect enterprise-level features that would cause migration issues when moving from higher editions (Enterprise/Developer) to lower ones (Standard/Express). Common migration scenarios this helps validate include moving databases from development environments running Developer edition to production Standard edition, or consolidating databases from Enterprise to Standard during license optimization.

Read more

SQL Server Migration Enhancements

Chrissy LeMaire

A while back, I added some new features to our migration commands but I forgot to blog about them. Then, I used one of the new features for a fast and successful migration, got so pumped and had to share. Multiple Destinations Now, you can migrate from one server to many. This applies to both Start-DbaMigration and all of the Copy-Dba* commands, including Copy-DbaDatabase and Copy-DbaLogin. As you may be able to see in the title bar of this Out-GridView, I am migrating from workstation, which is a SQL Server 2008 instance, to localhost\sql2016 and localhost\sql2017.

Read more

Real-World TDE Database Migrations

In today’s post, I will tell you about how we managed to successfully complete a migration during a ~12 hour maintenance window. This could have taken a LOT longer if we didn’t have dbatools to automate several of the steps. Although I will not go in to every detail about our process, I want to emphasize the areas were we chose to use dbatools to make our lives easier. The Goal Recently, we got the green light for upgrading to SQL Server 2016 and we were ready to roll.

Read more
Page 4 of 5