You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Jetpack import fails due to Integrity constraint violation: 19 NOT NULL constraint failed: wp_posts.post_content_filtered error #253
The query doesn't list post_content_filtered which is a NOT NULL column, so the error is correct.
Perhaps the dump expects to be executed with a specific SQL mode that is non-strict? But in that case, a statement like SET SQL_MODE='...'; is usually included in the backup, but I wasn't able to find one.
We do support SET SQL_MODE='...'; and recognize some of the strict/non-strict SQL modes, and when set, the backup works.
So this problem seems to be rather about the usage of the backup—why does the backup seem to expect non-default SQL mode but doesn't set it anywhere? Is it expected to be used in some specific way?
So this problem seems to be rather about the usage of the backup—why does the backup seem to expect non-default SQL mode but doesn't set it anywhere? Is it expected to be used in some specific way?
If I am understanding correctly, from your point of view it looks like the backup itself isn't correct, right?
The file should be a standard Jetpack backup created from the site that is hosted on Pressable so I don't expect there should be anything special about it. Unless there's some bug. 🤔
I am going to check with Jetpack Backup folks to see if they can spot anything about that DB dump.
If I am understanding correctly, from your point of view it looks like the backup itself isn't correct, right?
@ivan-ottinger The backup looks kind of correct, but it seems that it's presuming a specific SQL mode or a specific way of importing, because I couldn't find a statement within the backup that would set the SQL mode for the backup connection.
@ivan-ottinger The backup looks kind of correct, but it seems that it's presuming a specific SQL mode or a specific way of importing, because I couldn't find a statement within the backup that would set the SQL mode for the backup connection.
Thanks for sharing. I looked into this a bit today from Studio perspective. I can imagine that we could rewrite the dump in Studio as the importing happens, but it might be better and cleaner to address the issue at the point where the backup is generated.
Let's see what our colleagues from Jetpack Backups think first. 🙂
Activity
JanJakes commentedon Oct 10, 2025
@ivan-ottinger I checked this, and this doesn't seem to be an issue with the driver.
There are some queries like this in the dump:
The query doesn't list
post_content_filteredwhich is aNOT NULLcolumn, so the error is correct.Perhaps the dump expects to be executed with a specific SQL mode that is non-strict? But in that case, a statement like
SET SQL_MODE='...';is usually included in the backup, but I wasn't able to find one.We do support
SET SQL_MODE='...';and recognize some of the strict/non-strict SQL modes, and when set, the backup works.So this problem seems to be rather about the usage of the backup—why does the backup seem to expect non-default SQL mode but doesn't set it anywhere? Is it expected to be used in some specific way?
That made me wonder whether
wp db importsets any non-default SQL modes, but I don't think so. It seems to directly use themysql/mariadbcommands.ivan-ottinger commentedon Oct 10, 2025
Thank you for looking into this @JanJakes!
That's helpful.
If I am understanding correctly, from your point of view it looks like the backup itself isn't correct, right?
The file should be a standard Jetpack backup created from the site that is hosted on Pressable so I don't expect there should be anything special about it. Unless there's some bug. 🤔
I am going to check with Jetpack Backup folks to see if they can spot anything about that DB dump.
JanJakes commentedon Oct 10, 2025
@ivan-ottinger The backup looks kind of correct, but it seems that it's presuming a specific SQL mode or a specific way of importing, because I couldn't find a statement within the backup that would set the SQL mode for the backup connection.
That's strange, because it means it would fail in MySQL the same way. Here's a demo: https://onecompiler.com/mysql/43z84u5br
ivan-ottinger commentedon Oct 10, 2025
Thanks for sharing. I looked into this a bit today from Studio perspective. I can imagine that we could rewrite the dump in Studio as the importing happens, but it might be better and cleaner to address the issue at the point where the backup is generated.
Let's see what our colleagues from Jetpack Backups think first. 🙂
JanJakes commentedon Apr 16, 2026
I believe this was fixed by Automattic/wp-cli-sqlite-command#17.