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
[feature request] sqlite db as an additional format for the export command #6001
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)
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.
Activity
danielbachhuber commentedon Oct 10, 2024
Thanks for the suggestion, @vadimkantorov !
Feel free to drop your thoughts on this existing issue for the topic: wp-cli/db-command#327