Blog Post

Azure Database Support Blog
1 MIN READ

Lesson Learned #335: BACKUP WITH COPY_ONLY cannot be performed until after the next automatic BACKUP

Jose_Manuel_Jurado's avatar
Mar 01, 2023

Today, we worked on a service request that our customer got the following error message: BACKUP WITH COPY_ONLY cannot be performed until after the next automatic BACKUP LOG operation [SQLSTATE 42000] (Error 41937) BACKUP DATABASE is terminating abnormally. [SQLSTATE 42000] (Error 3013), running a manual backup.

 

This error occurs when, for example, our customer changed encryption method or CMK/SMK. Database logs the change in encryption only affects new records so it is by design that there can be older parts of the log which are encrypted with the old encryption key.

 

So, in order to take a COPY_ONLY backup after the change in encryption parts of the log which are encrypted with the old key need to be truncated and one of the conditions for log truncation is that a log backup must be taken. 

 

Retry the operation after 10-15 minutes will be enough to overcome this error message.

 

Enjoy!

 

 

Published Mar 01, 2023
Version 1.0

1 Comment

  • scpman365's avatar
    scpman365
    Copper Contributor

    I waited a few hours but still got this error.

    When I switch to my own KeyVault TDE key. 

    I saw the old database encryption_state is 6

    6: Protection change in progress (The certificate or asymmetric key that is encrypting the database encryption key is being changed.)

    Any ideas? :sad: