SqlPkg is a 64-bit .NET command line (CLI) wrapper for the Microsoft SqlPackage CLI tool with the goal of making common backup and restore operations easier and more powerful. It does this through new Backup and Restore actions that provide additional features like the exclusion of specific table data in backups and destination prep prior to restore.
Visit the repository to see how you can install this tool to begin using it right away.
/Action:Backup
This mode is equivalent to Action:Export to create a .bacpac file, with the following differences.
/Action:Restore
This mode is equivalent to Action:Import to restore a .bacpac file, with the following differences.
/Action:Backup-All
This mode will back up all user databases on a server.
/Action:Restore-All
This mode will restore all *.bacpac files in a given path to databases with the same names as the filenames.
When not using SqlPkg special action modes, the entire argument list is simply piped to SqlPackage and will run normally. So you can use sqlpkg everywhere SqlPackage is used.
1. Install Microsoft .NET
SqlPkg requires that you already have the .NET 8.0 runtime installed, which you can get at https://dotnet.microsoft.com/en-us/download.
Because SqlPkg uses Microsoft SqlPackage, you will also need to install the .NET 6.0 runtime as well as SqlPackage.
2. Install SqlPkg
Run the following command in your command line interface (e.g. cmd, PowerShell, Terminal, bash, etc.):
Later you can update SqlPkg with the following command:
If you need to completely uninstall SqlPkg, use the command below:
There's usually more to the story so if you have questions or comments about this post let us know!
Do you need a new software development partner for an upcoming project? We would love to work with you! From websites and mobile apps to cloud services and custom software, we can help!