wp-sync-db / wp-sync-db-cli

Execute wp-sync-db migrations via WP-CLI
90 stars 41 forks source link

use wp-sync-db-cli to import wp-sync-db settings #2

Open pietervanh opened 9 years ago

pietervanh commented 9 years ago

Would it be possible to extend wp-sync-db-cli to set the wp-sync-db settings. For example you start from blank wordpress. Install and activate wp-sync-db , wp-sync-db-media-files, wp-sync-db-cli with wp-cli. Then set wp-sync-db settings with wp-sync-db-cli then run a wp-sync-db-cli pull.

tmuka commented 8 years ago

i found a way to do this by exporting the settings from a working local site that can already sync pull. wp option get wpsdb_settings --format=json --skip-plugins

then once you have that json string, use this wp option set wpsdb_settings --skip-plugins --format=json $CONTENTS"_OF_JSON_STRING_IN_QUOTES

you could probably also just modify the json the first time if you know the settings you want hope this helps!