Skip to content

[feature request] sqlite db as an additional format for the export command  #6001

@vadimkantorov

Description

@vadimkantorov

Sqlite integration is rapidly developing in:

It would be nice to have wp-cli natively supporting export of an existing WordPress installation as a single sqlite db file (an option to inclide any files in wp-uploads would also be great). Unfortunately, DDL and even the INSERT statements as exported by mysqldump cannot be piped into sqlite as is (e.g. for strings, backslash-escaped single quotes are used by mysqldump without a way to fix this: https://bugs.mysql.com/bug.php?id=65941 and because of DDL incompat, awk hack scripts like https://github.com/mysql2sqlite/mysql2sqlite and sed "s/\\\'/''/g" to_fix_backslash_escaping_single_quotes_in_insert_statements_of_data_dump.sql for postprocessing Mysql sql dumps are needed). So for avoiding hacks and a tested, streamlined experience, native support in wp-cli of direct export into a sqlite db file would be a great addition. In the meanwhile the Sqlite integration is developing, this export format can be a more compact than current xml format in https://developer.wordpress.org/cli/commands/export/ . In future, when sqlite integration is ready, this export mode will also be immediately useful to do conversion of WP installations from mysql to sqlite. Also a switch for command wp db export backup.sql to produce sqlite-dialected SQL files would be nice, but also directly producing a binary sqlite-db file would be more performant in many tasks (especially if many blobs are stored in the WP installation and would need to be exported in the db)

Also then a great tool https://sqlitebrowser.org/ can be used for inspecting the database.

Maybe outside of scope of wp-cli per se, but also a similar functionality would be very welcome for the UI of WordPress admin panel, as not always we have wp-cli access to the databases in cheap hosted WP installations.

A corresponding import functionality would also be very nice for importing from such sqlite-db-format backups in addition to xml/wxr backups.

Originally discussed here:

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