Title: Error while import settings as JSON from WP-CLI
Last modified: September 17, 2020

---

# Error while import settings as JSON from WP-CLI

 *  Resolved [th0masl](https://wordpress.org/support/users/th0masl/)
 * (@th0masl)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-while-import-settings-as-json-from-wp-cli/)
 * Hello,
 * I’m planning to do a WP CLI scripted deployment of the settings of the gdpr-cookie-
   compliance plugin, but I’m running into a strange problem.
 * I’m using a simple WP CLI command to export/import, that works with all the other
   plugins I’m using, but not with gdpr-cookie-compliance.
 * Here is how to reproduce the problem :
 * 1) Install the plugin
    2) Use WP CLI to export the config as JSON, with WP CLI,
   example : wp option get moove_gdpr_plugin_settings –format=json > /tmp/gdpr.json
 * 3) Change something in the config (some text, it doesn’t matter), and save your
   changes :
    nano /tmp/gdpr.json (and change some text)
 * 4) Try to import the JSON file with WP CLI, example :
    wp option update moove_gdpr_plugin_settings–
   format=json < /tmp/gdpr.json
 * Result :
    Error: Could not update option ‘moove_gdpr_plugin_settings’.
 * But strangely enough, the option has been updated anyway.
 * I’m using this same process for many other plugins, and I have this problem only
   with this plugin.
 * Do you have any idea about what could be the problem ?
 * I have the feeling that this is due to the encoding that is used when saving 
   the values in the WP Options.
 * According to the content of the JSON file, it looks like the gdpr-cookie-compliance
   plugin is converting the special charts to ASCII and escapes the ‘/’, even if
   it’s not really needed. Maybe that’s the reason of the problem ?
 * Thanks
 * Thomas

Viewing 1 replies (of 1 total)

 *  Plugin Author [Moove Agency](https://wordpress.org/support/users/mooveagency/)
 * (@mooveagency)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/error-while-import-settings-as-json-from-wp-cli/#post-13442467)
 * Hi [@th0masl](https://wordpress.org/support/users/th0masl/),
 * Thanks for using our plugins.
 * The export & import settings feature is part of our premium version.
    We are 
   using a separate database table for settings, and requires specific import & 
   export rules.
 * If you’re interested in premium version, you can purchase here: [https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/](https://www.mooveagency.com/wordpress-plugins/gdpr-cookie-compliance/)
 * Hope this makes sense.

Viewing 1 replies (of 1 total)

The topic ‘Error while import settings as JSON from WP-CLI’ is closed to new replies.

 * ![](https://ps.w.org/gdpr-cookie-compliance/assets/icon-256x256.png?rev=2376316)
 * [GDPR Cookie Compliance - Cookie Banner, Cookie Consent, Cookie Notice for CCPA, EU Cookie Law](https://wordpress.org/plugins/gdpr-cookie-compliance/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gdpr-cookie-compliance/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gdpr-cookie-compliance/)
 * [Active Topics](https://wordpress.org/support/plugin/gdpr-cookie-compliance/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gdpr-cookie-compliance/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gdpr-cookie-compliance/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Moove Agency](https://wordpress.org/support/users/mooveagency/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/error-while-import-settings-as-json-from-wp-cli/#post-13442467)
 * Status: resolved