How to sync data manually
The extension syncs your store data to the eChat knowledge base automatically via a daily cron job (at 2:00 AM). However, you can trigger a manual sync at any time using the CLI.
Sync all data types
bin/magento mirasvit:echat:sync
This command syncs all data sources: store information, products, categories, CMS pages and Mirasvit Knowledge Base articles. Each source lands in its own knowledge base category, which the extension creates on the first document.
One failing source is logged and skipped rather than stopping the run, and a source with nothing to send creates no empty category.
Sync a specific data type
Use the --type option to sync only a specific data type:
bin/magento mirasvit:echat:sync --type=product
bin/magento mirasvit:echat:sync --type=category
bin/magento mirasvit:echat:sync --type=cms_page
This is useful when you've made changes to only one type of content and want a faster sync.
Preview a sync without sending anything
Add --dry-run to see what would be sent, without creating or updating anything in the knowledge base:
bin/magento mirasvit:echat:sync --dry-run --limit=5
Each document is listed with its identifier, name and content length. --limit stops after the given number of documents per source, which keeps the output readable on a large catalog.
Documents are matched by identifier, and each source owns its own identifiers (product.42, cms_page.7, and so on). Anything stored under those identifiers is replaced on every run, so an edit made by hand in the backend's Knowledge Base screen does not survive the next sync - at 2:00 AM at the latest.
The product sync also removes what it no longer collects. A product that goes out of stock (when Display Out of Stock Products is set to No), is disabled, is hidden from the catalog or is deleted loses its knowledge base document on the next run, so the chatbot stops offering something your store cannot sell.
To add content that the sync leaves alone, give it an identifier of your own. See Knowledge Base.
When the sync removes nothing
A run only removes documents when it is certain it collected the whole catalog. It removes nothing, and says why on the console, when it was capped by --limit, when any document failed to upload, or when it collected nothing at all. A partial run cannot be told apart from a catalog that genuinely shrank, so it is treated as the first.
For the same reason --dry-run never removes anything, and does not preview removals either: it contacts eChat for nothing at all.
Your store's own content can be added to the chatbot's knowledge base as well - see How to add a custom data source.