Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Dernière révision Les deux révisions suivantes | ||
td_histoire_numerique:zotero [2019/02/27 22:24] Francesco Beretta [Accès depuis une autre base de données SQLite] |
td_histoire_numerique:zotero [2019/03/01 17:22] Francesco Beretta |
||
---|---|---|---|
Ligne 13: | Ligne 13: | ||
====== Accès direct à la base de donneés de Zotero ====== | ====== Accès direct à la base de donneés de Zotero ====== | ||
- | Documentation: [[https://www.zotero.org/support/dev/client_coding/direct_sqlite_database_access|Direct Access to the Zotero SQLite Database]] | + | Documentation: |
+ | * Liste à puce[[https://www.zotero.org/support/dev/client_coding/direct_sqlite_database_access|Direct Access to the Zotero SQLite Database]] | ||
+ | * [[https://www.zotero.org/support/zotero_data|Zootero data directory and database restore]] | ||
+ | * [[https://www.zotero.org/support/dev/client_coding/javascript_api|Zotero JavaScript API]] for local Zotero instance | ||
<code sql> | <code sql> | ||
Ligne 37: | Ligne 40: | ||
+ | |||
+ | ====== Zotero database locked ====== | ||
+ | |||
+ | |||
+ | ===== Meilleure solution ===== | ||
+ | |||
+ | Créer préalablement un dossier //zotero_copy// à côté du dossier de Zotero | ||
+ | |||
+ | <code bash> | ||
+ | cd [PATH to zotero.sqlite] | ||
+ | cp -pv zotero.sqlite ../zotero_copy/zotero.sqlite | ||
+ | </code> | ||
+ | |||
+ | On peut aussi effectuer cette opération manuellement. | ||
+ | |||
+ | |||
+ | ===== Solution trouvée dans un forum ===== | ||
+ | |||
+ | |||
+ | **Always make a copy of Zotero database first !** | ||
+ | |||
+ | <code bash> | ||
+ | cp -pv zotero.sqlite zotero.sqlite2 | ||
+ | rm -f zotero.sqlite | ||
+ | mv zotero.sqlite2 zotero.sqlite | ||
+ | </code> | ||
+ | |||
+ | |||
+ | Source: [[https://stackoverflow.com/questions/16419654/effectively-unlocking-an-sqlite-database|effectively unlocking an SQLite database]] | ||
+ | |||
+ | Repair database: [[https://www.zotero.org/utils/dbfix/|Zotero Database Repair Tool]]Your database has been rebuilt. | ||
+ | |||
+ | <code> | ||
+ | The new file is available here: | ||
+ | |||
+ | https://www.zotero.org/utils/dbfix/files/XG0S06XU/zotero.sqlite.zip (11605KB) | ||
+ | |||
+ | After downloading this file, unzip it, close Zotero, and place the extracted zotero.sqlite in your Zotero data directory, replacing the existing file. If there is a zotero.sqlite.is.corrupt file in the directory, delete it. (Be sure you've made a backup of the entire 'zotero' folder before performing these steps!) | ||
+ | |||
+ | When you're done, restart Zotero. | ||
+ | |||
+ | Please reference Upload ID 5c7841428fcf6 in any correspondence with the Zotero team regarding this repair. | ||
+ | </code> | ||
===== Accès depuis une autre base de données SQLite ===== | ===== Accès depuis une autre base de données SQLite ===== | ||
Ligne 58: | Ligne 104: | ||
\\ | \\ | ||
- | Mise à jour des données de la table zotero_data: | + | Mise à jour des données de la table zotero_data. Exécuter ce script SQL: |
<code sql> | <code sql> | ||
DELETE FROM zotero_data; | DELETE FROM zotero_data; | ||
INSERT INTO zotero_data (itemId, typeName, datation, title) | INSERT INTO zotero_data (itemId, typeName, datation, title) | ||
SELECT itemID, typeName, datation, title FROM zotero.v_zotero_items; | SELECT itemID, typeName, datation, title FROM zotero.v_zotero_items; | ||
- | </code | + | </code> |