Hello Everyone,
We have seen a problem while testing standard or custom functionality in T-1 box after database restore from PROD and deployed custom package which thrown a SQL server error as “Index on table is disabled or resides in a filegroup which is not online.” And the same issue observed at many functional processes.
Use the standard docs LINK to Export a copy of the standard user acceptance testing (UAT) database (.bacpac).
And use the LINK for Import of azure SQL backup(.bacpac) to your T-1 D365 environment.
As we know azure SQL backup (.bacpac) cannot be directly imported to T-1 box as T-1 has on-premise SQL server which accepts only (.bak) backup files. For the same we have to convert it from (.bacpac) to (.bak) using sqlpackage .NET Core and below commands.
SqlPackage.exe /a:import /sf:D:\Exportedbacpac\my.bacpac /tsn:localhost /tdn:<target database name> /p:CommandTimeout=1200 /TargetUser:”axdbadmin” /TargetPassword:”AOSWebSite@123″ /TargetTrustServerCertificate:True
While conversion is happening using the SQLPackage, it does lot of steps and this process takes couple of hours depending on the database size and the system configuration where you are executing this process.
I have seen a problem recently, where the re-indexing step got failed / not executed completely because of the VM got shutdown, in-between and the same backup was been taken to use in T-1 box where i have seen couple of issues as like below.
- Cannot insert a record in SysGlobalConfiguration table as record already exists.
- [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Index “I_6941TTSITEMDIMIDX” on table “INVENTSUMDELTADIM” (specified in the FROM clause) is disabled or resides in a filegroup which is not online.
After analysis on the converted database found that many table indexes were in disabled status and so when d365 application executes a selected statement where the index is used with through error as mentioned above in point 2.
To resolve this issue, you run reindexing on the database where you face the problem. But make sure you do fresh conversion of the *backpac file to complete successfully so that the rebuilding indexes step also completed.
Thanks
Happy Learning!