Azure SQL Database Import Failed: "The ImportExport operation with Request Id '05a0cfb0-6b10-4527-8252-197c2c567c5a' failed due to 'Target database is not empty. The import operation can only be performed on an empty database.'."

Azure Learner Corporate 0 Reputation points
2025-04-08T01:16:14.2566667+00:00

Hi,

I attempted to import from a bacpac file. I did not have any database of the same name in the server, so everything should be empty. However, I keep getting this error whenever I tried to import the database from a bacpac file:

The ImportExport operation with Request Id '...' failed due to 'Target database is not empty. The import operation can only be performed on an empty database.'.

Azure SQL Database
{count} votes

1 answer

Sort by: Most helpful
  1. PratikLad 800 Reputation points Microsoft External Staff
    2025-04-22T15:57:26.12+00:00

    Hi Azure Learner Corporate,

    Even though you don’t see a database with the same name, the error suggests that a database with the target name was already created before the import, and that's the issue — BACPAC imports require the database to not exist at all.

    Even though you didn't create a database manually, the import process might still hit that error if:

    • The target database already exists, even if it’s empty.
    • A database with the same name got created due to a previous failed import.
    • Or the tool creates the DB first, then attempts to import and fails if anything at all is present.

    Open the BACPAC file and review its contents to make sure it only includes the schema and data from the source database. It shouldn't contain user-specific objects like logins, users, roles, or anything else tied to particular accounts.


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.