Unable to export the SQL .bacpac filr from Azure SQL DB

Amey Chhatre 1 Reputation point
2022-12-29T07:45:55.557+00:00

We are trying to migrate Azure SQL DBs from one tenant to the another tenant. We used below approaches but in all we are failing.

We are getting below error -

One or more unsupported elements were found in the schema used as part of a data package.
Error SQL71501: Error validating element [DM].[#######]: View: [DM].[#######] contains an unresolved reference to an object. Either the object does not exist or the reference is ambiguous because it could refer to any of the following objects: [DM].[#######].[#######], [DM].[#######].[#######], [DM].[#######].[#######], [DM].[#######].[#######] or [DM].[#######].[#######].

Approaches we have used -

  1. Using Azure portal we performed Export operation on our source location.
  2. We performed Tasks->Export data in SSMS, only data is migrated, the Primary key and constraints also didn't migrate with the table structure
  3. Performed Export Data-tier application approach in SSMS, but getting same error message.
  4. Used PowerShell, but getting same error message.
  5. Generated script in SSMS and ran it on destination DB with exclusion of the problematic views. Schemas and all the tables got created but no data found in the tables. Also tried to recreate excluded views in the destination server but getting some errors.

In all above approaches we are getting the same error.

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. Alberto Morillo 34,676 Reputation points MVP Volunteer Moderator
    2022-12-29T12:25:12.773+00:00

    Please follow these steps:

    1. Try to script the View or Views that are mentioned on the error,
    2. Delete the offending objects from the database before exporting it.
    3. Export the database.
    4. Import the database on the new tenant.
    5. Recreate the offending objects on the destination database by running the scripts created on the first step.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.