-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Sqlite integration is rapidly developing in:
- Draft/POC for SQLite support in Core WordPress/wordpress-develop#3220
- Exhaustive MySQL Parser WordPress/sqlite-database-integration#157
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: