# Recent MariaDB Dump File Compatibility Change breaks ```wp db import -```

**URL:** https://discourse.roots.io/t/recent-mariadb-dump-file-compatibility-change-breaks-wp-db-import/27303
**Category:** trellis
**Tags:** deploys, trellis
**Created:** 2024-06-13T14:39:36Z
**Posts:** 4

## Post 1 by @hypotune — 2024-06-13T14:39:36Z

I’m curently upgrading an old trellis project which uses [trellis-database-uploads-migration](https://github.com/valentinocossar/trellis-database-uploads-migration/tree/master) to push / pull and backup databases.

It looks pretty old so I’ve no idea if anyone still uses it. However, a [recent compatibility change in mariadb](https://mariadb.org/mariadb-dump-file-compatibility-change/) introduces a breaking change that may affect anyone using a similar approach to

```
wp db export --allow-root - | gzip > {{ dump_file }}
```

This change inserts a comment at the top of the file which causes wp db import - to fail on `\-`

```
/*!999999\- enable the sandbox mode */
```

piping the export into awk as before gzipping seems to work conditionally but isn’t fully tested as yet:

```
awk 'NR == 1 && /!999999\\- enable the sandbox mode / {next} {print}'
```

**refs:**

> **[MariaDB Dump File Compatibility Change - MariaDB.org](https://mariadb.org/mariadb-dump-file-compatibility-change/)**
>
> To improve security, we had to break compatibility with older MariaDB dump files. This is why and how to workaround any issues.

[https://github.com/valentinocossar/trellis-database-uploads-migration/blob/7b9e818aa55ecbec16a50af2d4b17e00189dd7f1/database-pull.yml#L44C14-L44C61](https://github.com/valentinocossar/trellis-database-uploads-migration/blob/7b9e818aa55ecbec16a50af2d4b17e00189dd7f1/database-pull.yml#L44C14-L44C61)

---

## Post 2 by @ben — 2024-06-13T14:43:24Z

> <https://github.com/roots/trellis/issues/1517>
>
> ### Version
> 
> 1.22.0
> 
> ### What did you expect to happen?
> 
> Seamless sync between p…roduction/staging and development
> 
> ### What actually happens?
> 
> MariaDB 10.6.18 adds sandbox comman as per [release notes](https://mariadb.com/kb/en/mariadb-10-6-18-release-notes/) and the new line at the top of the db export breaks syncing.
> 
> ### Steps to reproduce
> 
> Just re-provision production/staging so the new MariaDB is installed there and then try exporting/importing db either through the amazing sync.sh or manually.
> 
> The line which is added is this:
> 
> `/*!999999\- enable the sandbox mode */`
> 
> ### System info
> 
> _No response_
> 
> ### Log output
> 
> _No response_
> 
> ### Please confirm this isn't a support request.
> 
> No

---

## Post 3 by @hypotune — 2024-06-13T20:31:43Z

I did a quick search prior to posting but I was on a train at the time, and github treated said search as a regex.

That’s my excuse :slight_smile:

---

## Post 4 by @ben — 2024-06-13T21:16:01Z

No worries at all, I just wanted to link the issue about this from the repo

What a weird, crazy bug :eyes:
