Microsoft SQL Server
Since: v2.2.0
GoBackup uses SqlPackage (opens in a new tab) to export Microsoft SQL Server database into a .sql
file.
Install tool
So you need to install sqlpackage
first.
$ sudo apt-get install libunwind8
$ wget https://aka.ms/sqlpackage-linux -O sqlpackage-linux-latest.zip
$ sudo mkdir /user/local/sqlpackage
$ sudo unzip sqlpackage-linux-latest.zip -d sqlpackage
$ chmod +x /user/local/sqlpackage/sqlpackage
$ sudo ln -s /user/local/sqlpackage/sqlpackage /usr/local/bin/sqlpackage
More infomaion about installation: https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-download (opens in a new tab)
Config keys
type: mssql
host
- SQL Server host, default:127.0.0.1
port
- SQL Server port, default:1433
database
- Database nameusername
- Username, default:sa
password
- PasswordtrustServerCertificate
- Will be passed tosqlpackage
as--trustServerCertificate
argument, default:false
args
- Additional options forsqlpackage
utility
https://github.com/gobackup/gobackup/blob/main/database/mssql.go (opens in a new tab)
Example
models:
my_app:
databases:
my_app:
type: mssql
host: 127.0.0.1
port: 1433
database: my_app_production
username: sa
password: sapassword