---json { "canonical": ":analytics:replication", "description": "The analysis and replication of a webpage are the cornerstones of the quality and performance of a page. This page explains how this is done.", "name": "Database Replication", "page_id": "670cgbvcwnweskpj0g3j5", "title": "How ComboStrap analyzes and replicates data ?" } --- ====== ComboStrap - Analytics and database replication ====== ===== About ===== The ''database replication process'' is the process that: * creates the [[data|analytical data]] if needed * replicates the data into the [[docs:analytics:database|database]]. ===== Sync ===== Because this is an intensive process, it happens slowly: * for every page visited * or for every page that gains or lost backlinks. And the output is [[:docs:cache:cache|cached]]. If you want to sync the database completely, you can: * run the [[#cli|cli]] * run the [[#search index manager|Search Index Manager]] ==== Search Index Manager ==== The ''search index manager'' is a plugin that will replicate the page data. See how to install it and run it on this page. [[:docs:utility:search_index_ manager]] ==== Cli ==== On the server, you can [[docs:admin:replication|replicate the data]] to the database with the [[:docs:admin:cli|cli]] following command cd $DOKUWIKI_HOME # optional (for farm) animal=animal-directory-name # command php ./bin/plugin.php combo metadata-to-database --host serverHostName --port 80 / ===== Monitoring ===== ==== The replication date ==== The replication date is stored in the ''date_replication'' metadata and can be seen via: * the [[docs:metadata:manager|metadata manager]] (integration tab) * the [[docs:metadata:viewer|Metadata Viewer]]. * or [[query|query]] . select path, date_replication from pages order by date desc limit 10; ==== The analytics date ==== You can see the analytics date on the ''date'' field of the [[data|JSON object]] Example of [[query|query]] . select path, json_extract(analytics, '$.date') as date from pages order by date desc limit 10; ==== Replication Request ==== When [[docs:navigation:backlink|backlinks]] are added or deleted, a replication request of the page is asked to update them. This request are stored in the table ''pages_to_replicate''. If you query this table, you would get all page that should be replicated in the near future. This table should be empty 99% of the time as this is a temporary table. select * from pages_to_replicate