bacpac has less records on local sql server

  • Hello Everyone,

    As a server, I use Azure SQL (Microsoft SQL Azure (RTM) - 12.0.2000.8 Nov 8 2022 12:27:23).

    And in my local machine, I am using SQL (Microsoft SQL Server 2017 (RTM-GDR) (KB5014354) - 14.0.2042.3 (X64) Apr 29 2022 21:04:31 Copyright (C) 2017 Microsoft Corporation Express Edition (64-bit) on Windows 10 Pro 10.0)

    I took bacpac from Azure SQL Server and restored it in my local SQL Server.

    But after restoring when I check the records in some tables on my local SQL it is showing less records I don't know why.

    Even I don't get any errors during bacpac export / import process.

    Kindly suggest.

     

     

  • There could be a few different reasons why you are seeing fewer records on your local SQL server than what you expect. It could be due to a permission issue, a synchronization issue with the server, or the data could have been corrupted during the transfer. It is also possible that the data was not completely transferred in the bacpac.

    To troubleshoot this issue, you may want to try the following steps:

    1. Check if the user you are using to access the SQL server has the correct permissions to view all the records.

    2. Check if the data is synchronized between the Azure SQL server and the local SQL server.

    3. Check if the bacpac file was completely transferred and if the data was corrupted during the transfer.

    4. Try restoring the bacpac file again and see if the issue persists.

    If the issue still persists, it would be best to contact Microsoft support for further assistance.

  • Hi Thanks for replying.

    1. Check if the user you are using to access the SQL server has the correct permissions to view all the records.

    The user is SQL server admin and has all the permissions.

    2. Check if the data is synchronized between the Azure SQL server and the local SQL server.

    Did not get any errors it was successfully completed.

    3. Check if the bacpac file was completely transferred and if the data was corrupted during the transfer.

    Did not get any errors it was successfully completed.

    4. Try restoring the bacpac file again and see if the issue persists.

    I did the same process twice but got the same result.

    Thanks

  • Is the Azure source DB a moving, operational database or is it a completely read only static database?

    A bacpac is only as good as the time it was created, if the source is operational and has data movement it is totally valid that the bacpac and source no longer match.

  • Bacpac will not capture active transactions. So if you start a bacpac and while it's running some number of transactions complete, they won't be a part of the bacpac. It's not the same as native SQL Server backups. In fact, the way bacpac's run, you can actually get one that can't be restored because transactions can complete and you get data from child tables that don't have parents. The best way to get a perfect backup using a bacpac from Azure SQL Database is to first copy your database in Azure. Then take the bacpac from the copy, which will be transaction free.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Thank you Grant! It worked

     

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply