--- # required metadata title: Export and Import a database with sqlpackage | SQL Server vNext CTP1 description: author: sanagama ms.author: sanagama manager: jhubbard ms.date: 11/10/2016 ms.topic: article ms.prod: sql-linux ms.technology: database-engine ms.assetid: e239793b-e630-4110-81cc-19b1ef8bb8b0 # optional metadata # keywords: "" # ROBOTS: "" # audience: "" # ms.devlang: "" # ms.reviewer: "" # ms.suite: "" # ms.tgt_pltfrm: "" # ms.custom: "" --- # Export and Import a database with sqlpackage [Restore a SQL Server database from Windows to Linux](sql-server-linux-restore-database.md) is the recommended method to migrate a database to SQL Server on Linux. The sqlpackage command line utility can be used to perform a number of operations on databases such as: - export a database (database schema and user data) to a .bacpac file - import a database (database schema and/or user data) from a .bacpac file - create a database snapshot (.dacpac) file for a database - incrementally update a database schema to match the schema of a source .dacpac file - create a Transact-SQL incremental update script that updates the schema of a target database to match the schema of a source database You can use the sqlpackage command line utility with Microsoft SQL Server running on-premises or in the cloud, on Linux, Windows or Docker and from Azure SQL Database. The sqlpackage command line utility is particularly useful when you wish to import a database from Azure SQL Database to SQL Server on Linux or vice-versa. ## sqlpackage location The sqlpackage command line utility is in the following location after you install SQL Server on Linux. Running sqlpackage with no command line parameters displays help about the available parameters: ```bash /opt/mssql/bin/sqlpackage ``` You can specify command line parameters for a number of actions along with action specific parameters and properties as follows: ```bash /opt/mssql/bin/sqlpackage {parameters}{properties}{SQLCMD Variables} /opt/mssql/bin/sqlpackage /Action:Extract /SourceServerName:tcp: /SourceDatabaseName: /TargetFile: /SourceUser: /SourcePassword: ``` Command line parameters can be specified using their short forms: ```bash /opt/mssql/bin/sqlpackage /a:Export /ssn:tcp: /sdn: /tf: /su: /sp: ``` ## Export a database (schema and user data) to a .BACPAC file Use the following command to export database schema and user data to a .BACPAC file: ```bash /opt/mssql/bin/sqlpackage /a:Export /ssn:tcp: /sdn: /su: /sp: /tf: ``` ## Import a database (schema and user data) from a .BACPAC file Use the following command to import database schema and user data from a .BACPAC file: ```bash /opt/mssql/bin/sqlpackage /a:Import /tsn:tcp: /tdn: /tu: /tp: /sf: ``` ## See also - [sqlpackage command line utility](https://msdn.microsoft.com/library/hh550080.aspx) - [Data-tier Applications](http://msdn.microsoft.com/library/ee210546.aspx)