SALG : 1-800-867-1389
EN
Dette indhold er ikke tilgængeligt på dit sprog, men her er den engelske version.

How to: Use the Import and Export Service in Azure SQL Database

Updated: October 16, 2014

The Import and Export service provides an easy way to migrate and archive Azure SQL Databases.

Before You Begin

Migrating your database is as simple as exporting the schema and data, storing this file in an Azure Storage Account, and then importing the file to create a new database. Import and Export can also be used for archiving, as well as combined with Database Copy to create a transactionally consistent copy of a database.

Recommendations

The Import and Export service is the preferred solution for migration and archival scenarios. When planning business continuity, Microsoft recommends using self-service features such as Geo-Restore and Point in Time Restore. For more information, see Azure SQL Database Backup and Restore.

Import operations complete faster when using the S2 and higher performance levels. You can easily downgrade the performance level after the import operation completes. The database size, schema complexity, and performance level impact the duration of export operations. Consider temporarily increasing the performance level to decrease export times.

Limitations and Restrictions

An export operation performs an individual bulk copy of the data from each table in the database, and therefore does not guarantee the transactional consistency of the exported data. If the data in the export (BACPAC file) is not transactionally consistent, subsequent imports of that file may fail. To avoid this, use the Azure SQL Database Copy Database feature to first create a transactionally consistent copy of your database, and then export the copy. For more information, see How to: Use Database Copy (Azure SQL Database). Automated exports always create a copy of the database and then exports from the copy.

Prerequisites

A Storage Account is required for storing BACPAC files. For more information about creating a storage account, see How to Create a Storage Account.

Export a Database from Azure SQL Database

  1. Log on to the Azure Management Portal.

  2. In the navigation pane, click SQL Databases. In the list view of SQL databases, click the name of the database you would like to export.

  3. On the task bar, click Export to open the Export Database dialog.

  4. Enter values for the Filename, Subscription, Blob Storage Account, Container, Server Login Name, and Password. Click the Check mark at the bottom of the dialog. Note that the server account must be a server-level principal login or a member of the dbmanager database role.

  5. After the export operation is complete, you can then import your BACPAC file to create a new Azure SQL Database or SQL Server database.

Create a New Database by Importing BACPAC File

  1. Log on to the Azure Management Portal.

  2. Click New > Data Services > SQL Database > Import. This will open the Import Database dialog.

  3. Click the folder under BACPAC URL to navigate to the Storage Account, Container, and file name of the exported .bacpac file. Click Open.

  4. Specify a name for the new SQL database. The database name must be unique on the server, so you cannot use the name of an existing database, and the name must comply with SQL Server rules for identifiers. For more information, see Identifiers.

  5. Specify Subscription, Service Tier, Performance LevelMax Size, and Server. Click the Arrow at the bottom of the dialog.

  6. Specify login details for the host server.

  7. To start the import operation, click the Check mark at the bottom of the dialog. The portal will display status information in the ribbon at the bottom of the page.

  8. To view your new database, click SQL Databases in the navigation pane and refresh the page.

Note: To create a new database using an existing automated export file, click SQL Databases > your database name > Configure > New Database in the Create From Export section.

Schedule an Automated Export

  1. Log on to the Azure Management Portal.

  2. In the navigation pane, click on SQL Databases. In the list view of SQL databases, click the name of the database you would like to schedule for automated exports.

  3. Click the Configure tab, and then on Export Status, click Automatic.

  4. On the Automated Export work space, specify settings for the following parameters:

    • Storage Account

    • Frequency

      • Specify the export interval in days.

      • Specify the start date and time. The time value on the configuration work space is UTC time, so note the offset between UTC time and the time zone where your database is located.

    • Retention

    • Credentials for the server that hosts your SQL database. Note that the account must be a server-level principal login - created by the provisioning process - or a member of the dbmanager database role.

  5. When you have finished configuring the export settings, click Save.

You can see the time stamp for the last export on under Automated Export in the Quick Glance section of the SQL Database Dashboard.

You can see the status and history of a scheduled export operation on the History tab of the server Quick Start page.

To change the settings for an automated export, select the SQL database, click the Configure tab, make your changes, and then click Save.

Import and Export a Database Using API

You can also programmatically import and export databases by using an API. For more information, see the Import Export example on Codeplex.

Resources

Syntes du, dette var nyttigt?
(1500 tegn tilbage)
Tak for din feedback

Fællesskabsindhold

Tilføj
Vis:
© 2014 Microsoft