ThemeFuse / Unyson-Backups-Extension

Backup & Demo Content - This extension lets you create an automated backup schedule, import demo content or even create a demo content archive for migration purposes.
http://manual.unyson.io/en/latest/extension/backups/
10 stars 17 forks source link

Preserve current tables encoding (utf8mb4) instead of creating tables from demo install data (which can be very old) #41

Closed ghost closed 7 years ago

ghost commented 7 years ago

Demo is created with latest encoding utf8mb4_unicode_520_ci but the client's server does not support such encoding. We need to detect and treat this case.

ghost commented 7 years ago

Skip CREATE TABLE sql (and encoding) from demo content table and use CREATE TABLE (and encoding) from current table (if exists).

spatricius commented 6 years ago

Hello @moldcraft ,

Preserving table structure is not always wanted, eg. I need to export a plugin settings in demo content. The plugin saves its settings by changing its table structure, ie. adding a new column in its items table.

After exporting, when I try to do import, there is an error: Failed to insert row ... Unknown column: ... . This is because the table structure is not being changed to accept data from new custom column.

Could you please find another way to preserve encoding and not to force preserving table structure? If no better solution can be found, you could at least add a filter here:

https://github.com/ThemeFuse/Unyson-Backups-Extension/blob/2a41a4e19820b77408a1782a2200eafb9b37012b/includes/module/tasks/type/class-fw-ext-backups-task-type-db-restore.php#L703

Thanks!