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

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

The option 4 for querystore query_capture_mode is not supported

(0) ShareShare
ReportReport
Posted on by 10

Hi community members,

I'm facing an issue while trying to import a recently exported bacpac on a local OneBox VM (D365 Version 10.0.4/Platform Update 28). Whenever I try to import the backup, it gives me the following error:

*** Error importing database:Could not import package.
The option 4 for querystore query_capture_mode is not supported.

Can someone suggest the solution for this? This has only started happening recently as this error was non-existent about 2 weeks back.

OneBox-DB-import-issue.png

I have the same question (1)
  • Verified answer
    Asif365 Profile Picture
    1,431 on at
    RE: The option 4 for querystore query_capture_mode is not supported

    It is a known issue. Currently there is no ETA when this problem will be solved. It is caused due to a setup mismatch between AzureSQL and SQL server. To solve this issue you have to run this SQL statement

    ALTER DATABASE [QueryStoreDB] SET QUERY_STORE (QUERY_CAPTURE_MODE = ALL); in the Azure SQL (UAT) environment before you export the database.

    and the o=ther solution is : 

    The solution is to rename the bacpac file to zip, extract the content and locate the "model.xml" file. Copy the "model.xml" file to a new location where you can locate it easily. Rename the zip file back to bacpac. Edit the "model.xml" file:

     

    From:

    <Property Name="QueryStoreCaptureMode" Value="4" />

     

    To:

    <Property Name="QueryStoreCaptureMode" Value="2" />

     

    Save the "model.xml" file.

     

    Now you need to use the "/ModelFilePath" parameter of SqlPackage.exe, and point it to your updated "model.xml" file. This will instruct the SqlPackage.exe to read the updated "model.xml" file and ignore the one from within the bacpac file.

  • Ubaid Ullah Profile Picture
    10 on at
    RE: The option 4 for querystore query_capture_mode is not supported

    Thank you so much Asif. I have tried the second option and it works.

  • babalalex Profile Picture
    411 on at
    RE: The option 4 for querystore query_capture_mode is not supported

    Hi ,

    I am facing the same issue while importing the bacpac from UAT to DEV environment.

    Before PU upgrade 33, I was able to do it smoothly.

    But now I am encountering the same error as above.

    As I need to modify the .bacpac file content only, I am not able to find

    Property Name="QueryStoreCaptureMode" Value="4" / in the model.xml file.

    So very much clueless how to resolve this error, as I am not able to get solution for this error.

    @Ubaid if you can throw some light on this. 

    It would be great help if you can guide me something about this.

    Any help appreciated.

    Regards,

    Sudeep Mali.

  • Suggested answer
    Christoph Thaler Profile Picture
    5,442 on at
    RE: The option 4 for querystore query_capture_mode is not supported

    Hi babalalex

    I had this issue in the past and was told to do this steps by the Microsoft support team:

    a. Run this SQL script in the Sandbox UAT (STAGE) environment:

    ALTER DATABASE [QueryStoreDB] SET QUERY_STORE (QUERY_CAPTURE_MODE = ALL);

    b. Export the STAGE database

    c. Transfer the DB backup to the OneBox

    d. Import as normal

  • babalalex Profile Picture
    411 on at
    RE: The option 4 for querystore query_capture_mode is not supported

    Hi Christ,

    Thanks for the quick response.

    My worry here is that,

    1. We have taken a backup of UAT and refreshed UAT DB from GOLD DB.

    2. We had planned to keep a backup of UAT DB in DEV environment so that we can refer to the previous UAT DB, not the current UAT DB which is from GOLD DB.

    Now, if I follow the steps recommended by MS; I may not get the UAT DB before DB refreshment from GOLD DB.

    Therefore, I want to resolve this error for previous UAT DB not current UAT DB.

  • Suggested answer
    Christoph Thaler Profile Picture
    5,442 on at
    RE: The option 4 for querystore query_capture_mode is not supported

    Hi babalalex,

    there is another discussion about this topic here: github.com/.../1933

    Try to get in contact with Lane.Swenka@microsoft.com...

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 722 Most Valuable Professional

#2
CU05031448-0 Profile Picture

CU05031448-0 614

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans