If you prefer to save the classic SQL Server database backup (.bak) to another machine, then the only option is to use a
BACKUP DATABASE with a shared folder.
If, in general, the backup format is not so important to you, then you can perform Export Data-Tier Application using the sqlpackage utility.
SqlPackage is not a third-party tool, but a Microsoft database migration utility.
sqlpackage.exe /action:Export /SourceServerName:<Server name> /SourceDatabaseName:<db name> /SourceUser:admin /SourcePassword:<password> /TargetFile:<patch to target .bacpac>
Export Data-Tier Application has two drawbacks:
- Works slower, and loads a database server, because of this, it is poorly applicable for large databases.
- Does not provide transactional data consistency. To get around this, it is recommended to create a snapshot of the database, and export the snapshot.
CREATE DATABASE AdventureWorks_Snapshot ON
( NAME = AdventureWorks, FILENAME = 'C:\Program Files\Microsoft SQL Server\MSSQL13.MSSQLSERVER\MSSQL\Data\AdventureWorks_data_1800.ss' )
AS SNAPSHOT OF AdventureWorks;
Once the export is completed, the snapshot can be removed.
DROP DATABASE [AdventureWorks_Snapshot]
More details can be found here:
How to Copy SQL Server Database from Windows to Linux
Export and import a database on Linux with SSMS or SqlPackage.exe on Windows