Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

RestoreDB error: connection successfully established with the server, error occurred

(0) ShareShare
ReportReport
Posted on by 144
Hi guys,
 
I want to restore UAT database to my own DevBox, but I have strange message while doing the import extraction using SqlPackage.
So when I run this command : 
SqlPackage.exe /a:Import /sf:C://Temp//MYuatbackup.bacpac /tsn:FODEV /tdn:AxDB_UAT /p:CommandTimeout=1200
 
I'm hit this error :
 
Importing to database 'AxDB_UAT' on server 'FODEV'.
Creating deployment plan
Initializing deployment
*** Changes to connection setting default values were incorporated in a recent release.  More information is available at https://aka.ms/dacfx-connection
*** Error importing database:Could not import package.
Unable to connect to target server 'FODEV'. Please verify the connection information such as the server name, login credentials, and firewall rules for the target server.
A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)
The certificate chain was issued by an authority that is not trusted
*** The settings for connection encryption or server certificate trust may lead to connection failure if the server is not properly configured.
 
May I know what's wrong and how to resolve it ? 
I'm trying to google it, and found this Microsoft docs -> https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/connect/error-message-when-you-connect But to be honest I'm confuse what to do. Because when it is said I need to Export Certificate from Personal, I didn't find the menu All task > Export. Also it is talking about obtain certificate from the server, what server does it mean because this is my DevBox which the server also in this VM.
But there is a note there : 

 

 Note

If you are using SQL Server Management Studio, select the Options tab, and select the Trust Server certificate option in the Connection Properties tab.

 
I tried to open my SSMS, but could not find the Connection Properties, could be different version, so I would like where exactly.
 
But most importantly is how to restore the database ? is my approach correct ?
 
Thanks.
 
  • Suggested answer
    Voltes Profile Picture
    Voltes 144 on at
    RestoreDB error: connection successfully established with the server, error occurred
    Ok,
    I added this command while running SqlPackage -> 
    /TargetTrustServerCertificate:True
    And it works.
     
    Solved.
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,759 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,468 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans