Importing MSSQL backup file from .bacpac file with sql package

Hanamant S Malakagond 41 Reputation points
2023-10-30T09:45:54.79+00:00

I am trying to import the .bacpac file from the help of SQLPACKAGE but failing with below error message.

I am trying to run command like below.

Starting up my mssql server like below

docker run -d -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=P9gjYCcaT8uXiBki" 
           -v c:\sqlpackage:/opt/sqlpackage -v c:\dkc.bacpac:/tmp/dkc.bacpac 
           -p 1433:1433 --name mssql-server-example mcr.microsoft.com/mssql/server:2019-CU8-ubuntu-18.04

Then trying to run the below command

docker exec <container_id> /opt/sqlpackage/sqlpackage 
       /a:Import /tsn:localhost /tdn:db /tu:sa 
       /tp:PDjdlJdjdsb /sf:/tmp/db.bacpac


Getting error like below.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught)

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
11,633 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ZoeHui-MSFT 27,466 Reputation points
    2023-10-31T02:12:20.8833333+00:00

    Hi @Hanamant S Malakagond,

    A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 35 - An internal exception was caught)

    There can be many reasons, check this article to see if it is helpful.

    Also check A network-related or instance-specific error occurred while establishing a connection to SQL Server.

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments