Bench backup/restore failing after recent MariaDB updates

In case you have one of these MariaDB versions installed - 10.5.25, 10.6.18, 10.11.8, 11.0.6, 11.1.5, 11.2.4 and 11.4.2 - you may notice that restoring from a backup generated by using bench backup (and subsequently running bench restore on another server) fails with error message ERROR at line 7: Unknown command '\\-'.\n".

This is being caused by recent security updates to MariaDB.
Read more here.

To fix this, simply extract your DB dump file using gzip -d <<filename>> and then delete the offending line (usually line 7) which reads something like /*!999999\- enable the sandbox mode */

Hope this helps

2 Likes