Tất cả tài liệu

Managed – FPT Database Engines (new)

    Migration cho SQL Server
    Migration cho SQL Server
    Updated on 17 Apr 2024

    1. Export Data Tier Application via SSMS tool

    Connect to a SQL instance and expand databases in the object explorer. Right-click on a database in SSMS and you get data-tier application options as shown below.

    Right-click on the source SQL Database and click on Export Data-tier application. It launches an introduction page. This introduction page defies the summary and high-level steps for this wizard. The high-level steps are as follows:

    Click Next, and it takes you to the Export setting page.

    Let’s use a local disk directory, as shown below.

    By default, it extracts all schema, tables (with data) available in the database. We can also filter selected objects in the advanced page select all database schema, tables in the advanced tab of this page. Click on the advanced tab and review the objects. It groups objects per schema such as dbo.

    We are not using any object filtering in BACPAC export. It will create an export for all tables in the database. Click on Next and review the configurations.

    Click Finish, and it starts the export of the database. You can see the success message for each step.

    We can browse to the directory and verify a BACPAC extension file exists.

    2. Import a BACPAC file using SSMS Import Data-tier Application wizard

    We can copy this BACPAC file to destination SQL instance having either on-premise or Azure SQL Database. Right-click on the connected destination instance and launch Import Data-tier applications wizard.

    Click Next, and it takes you to the import settings page. Here, we specify the path of a BACPAC file either from the local disk or Microsoft Azure Storage container. We used local disk storage during the import process so, select the local disk option and browse to the directory containing required BACPAC package.

    In the next page, we specify a setting for the new database. We cannot use an existing SQL Database for importing a BACPAC package.

    It also requires input for the data and log file of this new database. By default, it shows you default data and log file location of connected SQL instance. We can change it per requirement.

    Modify the new database name. In my demonstration, I specified AdventureWorksDW_BACPAC name for SQL Database. Click Next and view summary.

    The next page is a summary page showcasing your configurations. I recommend you always review it before proceeding. You can easily navigate back and make the required changes.

    Click Finish, and you can see the following steps. • Creates a new database • Imports schema and data into this new database • Disables indexes • Inserts data into tables • Enable indexes

    Refresh the object explorer, and you see the newly restored database.