web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Access Denied while importing the database

(0) ShareShare
ReportReport
Posted on by 575

Guys,

I exported Sandbox db from LCS and copied to my Onebox

I am restoring my Onebox db from SBX DB data  

I am importing my database in to Onebox db

C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin>SqlPackage.exe /a:import /sf:C:\SBXSQLBACKUP\SBbackup.bacpac/tsn:D365-Dev04/tdn:AXDBSBXCOPY/p:CommandTimeout=1200

I am getting This info

3414.pastedimage1581067935335v1.png

After closing this I am getting Access is Denied msg in command prompt. I am running cmd only as administrator. Any ideas are welcome

I have the same question (0)
  • Clive Richard Profile Picture
    on at

    Hi Veera,

    If you are using the same command mentioned in your post then your command is missing "SPACE" I highlighted it in Red below. example after .bacpac /tsn:D365. Please use the command with space and let me know if you still face issue. 

    C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin>SqlPackage.exe /a:import /sf:C:\SBXSQLBACKUP\SBbackup.bacpac/tsn:D365-Dev04/tdn:AXDBSBXCOPY/p:CommandTimeout=1200

    Regards,

    Clive Purushothaman

    This post is my own opinion and does not necessarily reflect the opinion or view of my company or Microsoft.

  • veera seenivasan Profile Picture
    575 on at

    Thanks for your reply clive. The same issue exist

  • Clive Richard Profile Picture
    on at

    Hello Veera,

    Please use the below command with user and password which has access to your SQL as Admin (create DB rights).

    SqlPackage.exe /a:import /sf:"C:\Temp\testUATbackup.bacpac" /tsn:<your value> /UserId=axdbadmin /Password=********** /tdn:<your value> /p:CommandTimeout=1200

    Let me know the result and also the error screenshot. 

    Regards,

    Clive Purushothaman

    This post is my own opinion and does not necessarily reflect the opinion or view of my company or Microsoft.

  • Suggested answer
    Asif365 Profile Picture
    1,431 on at

    1. Run command prompt as an administrator.

    go to Directory where SQLpackage.exe located.

    cd C:\Program Files (x86)\Microsoft SQL Server\130\DAC\bin

    2. Run the below command to Import the database

    SqlPackage.exe /a:import /sf:C:\SBXSQLBACKUP\SBbackup.bacpac /tsn:localhost /tdn:AXDBSBXCOPY /p:CommandTimeout=1200

    5428.pastedimage1581083169521v1.png

     Note

    During import, the user name and password aren't required. By default, SQL Server uses Microsoft Windows authentication for the user who is currently signed in

  • veera seenivasan Profile Picture
    575 on at

    Thanks for your reply Asif. The same issue exist

  • Community Member Profile Picture
    on at

    Many web hosts only give you access to one database. Your SQL file is trying to create a new database (with a line near the top like CREATE DATABASE `socialnew`... as you see in the error message).

    The likely solution is to not create the database from your script. You can either edit the .sql file manually and remove the lines starting with CREATE DATABASE `socialnew`... and USE `socialnew`;, or, if your phpMyAdmin is pretty up-to-date, you could do the export again from your XAMPP and make sure the checkbox is not selected for "Add CREATE DATABASE / USE statement".

    Then when doing the import, make sure you're selecting the Import tab from within the database you wish to import to.

  • Suggested answer
    Asif365 Profile Picture
    1,431 on at

    You probably have some security permission issue. Try these method

    1.  SqlPackage.exe /a:import /sf:C:\SBXSQLBACKUP\SBbackup.bacpac /tsn:localhost /userId=axdbadmin /Password=AOSWebSite@123 /tdn:AXDBSBXCOPY /p:CommandTimeout=1200

    Note: In oneBox dev environment the axdbadmin has default password is :"AOSWebSite@123"

    2.Open SQL management Studio and try to import with GUI method.

    Open SSMS connect {"localhost or "."} with Sql Authentication user "axdbadmin" and pass:"AOSWebSite@123"
    3173.pastedimage1581101558891v1.png

    2425.pastedimage1581086502773v2.png

    8688.pastedimage1581086625306v3.png

    2234.pastedimage1581086712163v4.png

    let us know if issue still persist.

  • Ameen1623 Profile Picture
    on at

    Hi Veera,

      Am getting the same error. Did you find the solution

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 451 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 428 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans