workflowstacks
automation

dbatools: Automate SQL Server

Faster, safer SQL Server migrations for founders. 2.8k+ GitHub stars
2,823 stars865 forksPowerShellHealth Score 9/10Updated 8/17/2026100% free · open source
What it does

dbatools is a PowerShell module that automates SQL Server migrations and administration tasks, making it faster and safer for founders to manage their databases

Install / run
Install-Module -Name dbatools
When to use it
  • When migrating a SQL Server database to a new instance or environment
  • When automating repetitive database administration tasks, such as backups or index maintenance
  • When needing to quickly diagnose and troubleshoot SQL Server performance issues
Quick start
  1. 1Import the dbatools module with `Import-Module dbatools`
  2. 2Use `Get-DbaDatabase` to retrieve a list of databases on a SQL Server instance
  3. 3Run `Backup-DbaDatabase` to create a backup of a database
  4. 4Use `Copy-DbaLogin` to copy logins from one SQL Server instance to another
  5. 5Reference the `dbatools.json` configuration file to customize settings and options
Ready-to-paste prompt
Get-DbaDatabase -SqlInstance 'localhost' -Database 'mydatabase' | Backup-DbaDatabase -Path 'C:\backups'
Heads up: Ensure you have the necessary permissions and credentials to access and manage the SQL Server instances, as dbatools will prompt for authentication if not properly configured
Saves to your device

Topics

backup
best-practices
database
database-administration
migrations
mssql
powershell
sql-server
sql-server-migration
What's inside — free to inspect
No purchase needed

Read the entire source before you build — unlike paid marketplaces that hide it behind a buy button.

13
top-level files
12
folders
91.4M
source size
MIT
license
Key files
AGENTS.md
readme.md
File tree
.claude/
.devcontainer/
.github/
.vscode/
bin/
docs/
en-us/
opt/
private/
public/
tests/
xml/
.gitattributes
.gitignore
.markdownlint.json
AGENTS.md
CLAUDE.md
cleanup.ps1
code_of_conduct.md
codecov.yml
CONTRIBUTING.md
dbatools.psd1
dbatools.psm1
license
Quick Actions
Details
Creator
dataplat
Language
PowerShell
Category
automation
Published
2/2/2015

Are you the creator of this tool? Claim your listing → and earn 85% of every sale.