Skip to content

Emoji Icons not exported with wp db export #213

Closed
@planetahuevo

Description

@planetahuevo

Bug Report

Is your bug report directly related to a specific command?
Yes wp db export
--- ✅ If you are in the correct location now... --->

Describe the current, buggy behavior

I was having a problem with an migration of a website that just after importing on the destination site, all widgets disappear.

The content of the widget HTML (wp_options database, 'widget_custom_html') appears correctly imported on the database for a moment just before to disappear, the moment you load the page.

On the database the content is replaced by
a:1:{s:12:"_multiwidget";i:1;}

That destroyed all widgets on the site, of course.

I though that this was a problem with the import, the database, the theme, well, it has been a lot of testing to find the issue.

The problem is that the export of the database using wp db replaces some emojis with ?? so the database "fails" somehow and remove the whole serialized content, eliminating all widgets on site.

I think is because some icons 👨‍🏫 are replaced by ?? instead, so that breaks the whole thing.

To replicate:
Create a widget Custom HTML, using classic widgets (I have not tested it with gutenberg widgets).
Original content:

ecommerce</i> 👨‍🏫

Exported content (and imported):
ecommerce</i> ??

Exporting with mysqldump exports correctly the 🚀 and the import with wp db works fine.

Describe what you would expect as the correct outcome

I expect the export file to have the emojis 🚀 and not ? instead.

OS:     Linux 4.15.0-161-generic #169-Ubuntu SMP Fri Oct 15 13:41:54 UTC 2021 x86_64
Shell:  /bin/bash
PHP binary:     /usr/bin/php7.4
PHP version:    7.4.7
php.ini used:   /etc/php/7.4/cli/php.ini
MySQL binary:   /usr/bin/mysql
MySQL version:  mysql  Ver 8.0.19-10 for debian-linux-gnu on x86_64 (Percona Server (GPL), Release '10', Revision 'f446c04')
SQL modes:
WP-CLI root dir:        phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:      phar://wp-cli.phar/vendor
WP_CLI phar path:       /var/www/EDITED/htdocs
WP-CLI packages dir:    /home/EDITED/.wp-cli/packages/
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.5.0

Provide a possible solution
No idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions