SQL Server Express - .bak restore failed due to size limit

tomas-krchnak 0 Reputation points
2023-06-28T08:24:39.2866667+00:00

I am using MS SQL Express 2019 and I am not able to restore database backup created with this edition due to size limit.

Error detail: CREATE DATABASE or ALTER DATABASE failed because the resulting cumulative database size would exceed your licensed limit of 10240 MB per database. RESTORE DATABASE is terminating abnormally.

How is this even possible?

There are some varbinary filesteam columns but if I am not wrong (https://learn.microsoft.com/en-us/sql/relational-databases/blob/filestream-compatibility-with-other-sql-server-features?redirectedfrom=MSDN&view=sql-server-ver15) these should not be taken into account for size limit of MS SQL Express.

SQL Server | Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Olaf Helper 47,436 Reputation points
    2023-06-28T08:34:13.85+00:00

    How is this even possible?

    If the error message says, the database size it to large for Express limitation of 10 GB, then it is to large.


  2. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-06-28T21:45:56.3033333+00:00

    I think the best advice I can give is to install an instance of Developer Edition and restore the backup on this edition. Then you can check the sizes. If you find that the size without the filestream data is less than 10 GB, there is either an error in the documentation or in SQL Server.

    Another thing you can try is something like:

    RESTORE DATABASE filestreamtest FILEGROUP = 'PRIMARY' FROM DISK = 'C:\temp\filestreamtest.bak' WITH PARTIAL, RECOVERY
    

    This restores only the primary filegroup, but not the filestream data.

    I agree that it is unexpected that the backup does not restore on Express, if it was indeed taken on Express. But without a repro for the issue it is difficult to comment in more detail.


  3. Anonymous
    2023-06-29T02:18:39.1066667+00:00

    Hi @tomas-krchnak

    You can try to shrink the source database and make a backup again, of course this is not the best solution. As Erland said, the best advice is to upgrade Express to the Developer edition. Go to SQL Server Installation Center->Maintenance->Edition upgrade.

    For more details, you can refer to these links:

    https://dba.stackexchange.com/questions/75220/reducing-database-size-to-restore-to-sql-server-express

    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ffff6205-f986-4b54-ae55-081c359fee9f/database-restored-failed-because-licensed-limits-10240mb-per-database-in-ssms?forum=sqldataaccess.

    Best regards,

    Aniya


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.