[{"data":1,"prerenderedAt":502},["ShallowReactive",2],{"navigation":3,"\u002Fdocs\u002Fsetting-up\u002Fbackups-restore-and-updates":179,"\u002Fdocs\u002Fsetting-up\u002Fbackups-restore-and-updates-surround":501},[4,33,64,100,130,165],{"title":5,"path":6,"stem":7,"children":8,"icon":32},"Start here","\u002Fdocs\u002Fgetting-started","1.docs\u002F1.getting-started\u002F1.index",[9,12,17,22,27],{"title":10,"path":6,"stem":7,"icon":11},"What it does","i-lucide-book-open",{"title":13,"path":14,"stem":15,"icon":16},"Signing in","\u002Fdocs\u002Fgetting-started\u002Fsigning-in","1.docs\u002F1.getting-started\u002F2.signing-in","i-lucide-log-in",{"title":18,"path":19,"stem":20,"icon":21},"Finding your way around","\u002Fdocs\u002Fgetting-started\u002Ffinding-your-way","1.docs\u002F1.getting-started\u002F3.finding-your-way","i-lucide-compass",{"title":23,"path":24,"stem":25,"icon":26},"Who can do what","\u002Fdocs\u002Fgetting-started\u002Froles","1.docs\u002F1.getting-started\u002F4.roles","i-lucide-users",{"title":28,"path":29,"stem":30,"icon":31},"Words you will see","\u002Fdocs\u002Fgetting-started\u002Fwords","1.docs\u002F1.getting-started\u002F5.words","i-lucide-book-a","i-lucide-rocket",{"title":34,"icon":35,"path":36,"stem":37,"children":38,"page":63},"Selling","i-lucide-scan-barcode","\u002Fdocs\u002Fselling","1.docs\u002F2.selling",[39,43,48,53,58],{"title":40,"path":41,"stem":42,"icon":35},"Making a sale","\u002Fdocs\u002Fselling\u002Fthe-till","1.docs\u002F2.selling\u002F1.the-till",{"title":44,"path":45,"stem":46,"icon":47},"Receipts and the printer","\u002Fdocs\u002Fselling\u002Freceipts","1.docs\u002F2.selling\u002F2.receipts","i-lucide-receipt",{"title":49,"path":50,"stem":51,"icon":52},"A day's sales, voids and refunds","\u002Fdocs\u002Fselling\u002Fsales-by-day","1.docs\u002F2.selling\u002F3.sales-by-day","i-lucide-calendar-days",{"title":54,"path":55,"stem":56,"icon":57},"Closing the day","\u002Fdocs\u002Fselling\u002Fclosing-the-day","1.docs\u002F2.selling\u002F4.closing-the-day","i-lucide-send",{"title":59,"path":60,"stem":61,"icon":62},"When Chemistbook is not answering","\u002Fdocs\u002Fselling\u002Fwhen-you-cannot-reach-the-pc","1.docs\u002F2.selling\u002F5.when-you-cannot-reach-the-pc","i-lucide-plug-zap",false,{"title":65,"icon":66,"path":67,"stem":68,"children":69,"page":63},"Stock","i-lucide-boxes","\u002Fdocs\u002Fstock","1.docs\u002F3.stock",[70,75,80,85,90,95],{"title":71,"path":72,"stem":73,"icon":74},"Adding a product","\u002Fdocs\u002Fstock\u002Fproducts","1.docs\u002F3.stock\u002F1.products","i-lucide-pill",{"title":76,"path":77,"stem":78,"icon":79},"Finding a medicine on the FDA list","\u002Fdocs\u002Fstock\u002Fthe-fda-register","1.docs\u002F3.stock\u002F2.the-fda-register","i-lucide-badge-check",{"title":81,"path":82,"stem":83,"icon":84},"Ordering and taking a delivery","\u002Fdocs\u002Fstock\u002Fpurchases-and-deliveries","1.docs\u002F3.stock\u002F3.purchases-and-deliveries","i-lucide-truck",{"title":86,"path":87,"stem":88,"icon":89},"Expiring stock and stock set aside","\u002Fdocs\u002Fstock\u002Fexpiry-and-quarantine","1.docs\u002F3.stock\u002F4.expiry-and-quarantine","i-lucide-calendar-clock",{"title":91,"path":92,"stem":93,"icon":94},"Throwing stock away properly","\u002Fdocs\u002Fstock\u002Fdisposals","1.docs\u002F3.stock\u002F5.disposals","i-lucide-flame",{"title":96,"path":97,"stem":98,"icon":99},"Counting the shelf","\u002Fdocs\u002Fstock\u002Fstocktakes","1.docs\u002F3.stock\u002F6.stocktakes","i-lucide-clipboard-list",{"title":101,"icon":102,"path":103,"stem":104,"children":105,"page":63},"Staying legal","i-lucide-shield-check","\u002Fdocs\u002Fcompliance","1.docs\u002F4.compliance",[106,110,115,120,125],{"title":107,"path":108,"stem":109,"icon":79},"Your licence and the shop's details","\u002Fdocs\u002Fcompliance\u002Flicence-and-shop","1.docs\u002F4.compliance\u002F1.licence-and-shop",{"title":111,"path":112,"stem":113,"icon":114},"Reminders","\u002Fdocs\u002Fcompliance\u002Freminders","1.docs\u002F4.compliance\u002F2.reminders","i-lucide-bell",{"title":116,"path":117,"stem":118,"icon":119},"Reports for the accountant and the inspector","\u002Fdocs\u002Fcompliance\u002Freports-and-exports","1.docs\u002F4.compliance\u002F3.reports-and-exports","i-lucide-file-spreadsheet",{"title":121,"path":122,"stem":123,"icon":124},"The day's, week's and month's figures","\u002Fdocs\u002Fcompliance\u002Fsales-summaries","1.docs\u002F4.compliance\u002F4.sales-summaries","i-lucide-chart-column",{"title":126,"path":127,"stem":128,"icon":129},"Who did what","\u002Fdocs\u002Fcompliance\u002Faudit-trail","1.docs\u002F4.compliance\u002F5.audit-trail","i-lucide-scroll-text",{"title":131,"icon":132,"path":133,"stem":134,"children":135,"page":63},"Looking after the shop","i-lucide-settings-2","\u002Fdocs\u002Fadministration","1.docs\u002F5.administration",[136,140,145,150,155,160],{"title":137,"path":138,"stem":139,"icon":26},"People and what they may do","\u002Fdocs\u002Fadministration\u002Fusers-and-roles","1.docs\u002F5.administration\u002F1.users-and-roles",{"title":141,"path":142,"stem":143,"icon":144},"Messages to the owner","\u002Fdocs\u002Fadministration\u002Fmessages","1.docs\u002F5.administration\u002F2.messages","i-lucide-message-square-text",{"title":146,"path":147,"stem":148,"icon":149},"The Chemistbook window","\u002Fdocs\u002Fadministration\u002Finstall-as-an-app","1.docs\u002F5.administration\u002F3.install-as-an-app","i-lucide-app-window",{"title":151,"path":152,"stem":153,"icon":154},"Backups","\u002Fdocs\u002Fadministration\u002Fbackups","1.docs\u002F5.administration\u002F4.backups","i-lucide-database-backup",{"title":156,"path":157,"stem":158,"icon":159},"Updates","\u002Fdocs\u002Fadministration\u002Fupdates","1.docs\u002F5.administration\u002F5.updates","i-lucide-package-check",{"title":161,"path":162,"stem":163,"icon":164},"Your colours, logo and receipt","\u002Fdocs\u002Fadministration\u002Fyour-brand","1.docs\u002F5.administration\u002F6.your-brand","i-lucide-palette",{"title":166,"icon":167,"path":168,"stem":169,"children":170,"page":63},"The law behind it","i-lucide-scale","\u002Fdocs\u002Fregulation","1.docs\u002F6.regulation",[171,175],{"title":172,"path":173,"stem":174,"icon":102},"What an OTCMS may sell","\u002Fdocs\u002Fregulation\u002Fwhat-the-shop-may-sell","1.docs\u002F6.regulation\u002F1.what-the-shop-may-sell",{"title":176,"path":177,"stem":178,"icon":129},"The records the law wants","\u002Fdocs\u002Fregulation\u002Fthe-records-the-law-wants","1.docs\u002F6.regulation\u002F2.the-records-the-law-wants",{"id":180,"title":181,"body":182,"description":493,"extension":494,"links":495,"meta":496,"navigation":63,"path":497,"seo":498,"stem":499,"__hash__":500},"docs\u002F1.docs\u002F7.setting-up\u002F3.backups-restore-and-updates.md","Backups, restore and updates",{"type":183,"value":184,"toc":486},"minimark",[185,199,203,215,227,257,280,283,287,294,297,332,335,343,350,353,391,394,397,401,404,407,410,432,437,444,448,451,479,482],[186,187,188],"note",{},[189,190,191,192,195,196,198],"p",{},"This page is for whoever installs and looks after the shop PC, and uses the words of that job. It is not in the guide's menu on purpose; the owner's pages are ",[193,194,151],"a",{"href":152}," and ",[193,197,156],{"href":157},".",[200,201,151],"h2",{"id":202},"backups",[189,204,205,206,210,211,214],{},"Chemistbook backs itself up. Every hour it looks at when the last good backup was made, and writes one when that was 20 hours ago or more, so a PC that is off at night still gets one within the hour of coming on. ",[207,208,209],"strong",{},"Back up now",", on ",[207,212,213],{},"Comply → Compliance → Backups",", writes one at once.",[189,216,217,218,222,223],{},"Each backup is a copy of the whole database, taken while the shop goes on selling, into ",[219,220,221],"code",{},"C:\\ProgramData\\Chemistbook\\backups",". Before it counts, the copy is opened on its own and must pass SQLite's integrity check and hold every record saved before it began; a copy that fails either is deleted and the run is reported as failed. The note on each run says how far the records go: ",[224,225,226],"em",{},"Records up to audit row 2126 and stock row 1709; checked whole.",[228,229,230,245,251],"ul",{},[231,232,233,236,237,240,241,244],"li",{},[207,234,235],{},"Encrypted"," with the backup passphrase from the install: the file ends in ",[219,238,239],{},".cbk",". Without a passphrase the file is the plain database, ",[219,242,243],{},".db",", and the Backups screen says so.",[231,246,247,250],{},[207,248,249],{},"Copied off the PC"," to the off-site folder from the install, a USB drive or a folder a sync client takes to the cloud. When the folder is not there, the copy waits and is tried again after 5, 15 and 30 minutes and then every hour. It counts only when the copy reads back the same as the file on the PC.",[231,252,253,256],{},[207,254,255],{},"Kept:"," the newest 14 on the PC, and any not yet copied off it. Nothing is ever deleted from the off-site folder.",[189,258,259,260,263,264,267,268,195,271,274,275,279],{},"The passphrase and the off-site folder are in the settings file, ",[219,261,262],{},"C:\\ProgramData\\Chemistbook\\settings\\chemistbook.yaml",", under ",[219,265,266],{},"otcms: backups:"," as ",[219,269,270],{},"passphrase",[219,272,273],{},"offsite-dir",". To change either, edit the file as an administrator and restart the service (see ",[193,276,278],{"href":277},"\u002Fdocs\u002Fsetting-up\u002Fmail-and-sms-settings#changing-a-setting","Mail and text messages","). A new passphrase applies to the backups written after; the old ones still need the old passphrase.",[189,281,282],{},"Once a day, at 07:35 or in the first hour the PC is on after that and never after 21:35, a check raises a reminder and tells the owners if the last backup failed or the last good one is more than 28 hours old.",[200,284,286],{"id":285},"putting-a-backup-back","Putting a backup back",[189,288,289,290,293],{},"A backup is turned back into a database file by the restore command that comes with Chemistbook. It writes a ",[207,291,292],{},"new"," file and never writes over one, then checks it: SQLite's integrity check, both hash chains of the record walked from the first row, and the seal of what it holds printed.",[189,295,296],{},"In PowerShell, run as administrator:",[298,299,304],"pre",{"className":300,"code":301,"language":302,"meta":303,"style":303},"language-powershell shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","$cb = \"$env:ProgramFiles\\Chemistbook\"\n& \"$cb\\runtime\\bin\\java.exe\" --enable-native-access=ALL-UNNAMED -cp \"$cb\\app\\chemistbook.jar\" `\n  \"-Dloader.main=com.otcms.api.backup.BackupRestoreCli\" org.springframework.boot.loader.launch.PropertiesLauncher `\n  \"E:\\Chemistbook backups\\chemistbook-2026-10-09-020252-030.cbk\" \"$env:TEMP\\restored.db\"\n","powershell","",[219,305,306,314,320,326],{"__ignoreMap":303},[307,308,311],"span",{"class":309,"line":310},"line",1,[307,312,313],{},"$cb = \"$env:ProgramFiles\\Chemistbook\"\n",[307,315,317],{"class":309,"line":316},2,[307,318,319],{},"& \"$cb\\runtime\\bin\\java.exe\" --enable-native-access=ALL-UNNAMED -cp \"$cb\\app\\chemistbook.jar\" `\n",[307,321,323],{"class":309,"line":322},3,[307,324,325],{},"  \"-Dloader.main=com.otcms.api.backup.BackupRestoreCli\" org.springframework.boot.loader.launch.PropertiesLauncher `\n",[307,327,329],{"class":309,"line":328},4,[307,330,331],{},"  \"E:\\Chemistbook backups\\chemistbook-2026-10-09-020252-030.cbk\" \"$env:TEMP\\restored.db\"\n",[189,333,334],{},"It asks for the passphrase. What it says when all is well:",[298,336,341],{"className":337,"code":339,"language":340},[338],"language-text","Restored chemistbook-2026-10-09-020252-030.cbk to C:\\Users\\…\\Temp\\restored.db.\nThe file checks whole.\naudit trail (audit_event): 2126 rows, whole; last row 2126\nstock ledger (inventory_movement): 1709 rows, whole; last row 1709\nSeal of these records: 2126.1709-84a3df48d230\n","text",[219,342,339],{"__ignoreMap":303},[189,344,345,346,349],{},"With the wrong passphrase it says ",[224,347,348],{},"The passphrase is wrong, or the backup is damaged."," and writes nothing. A damaged file or a broken chain is named.",[189,351,352],{},"To put it in place of the shop's records:",[354,355,356,369,383,388],"ol",{},[231,357,358,359,362,363,362,366,198],{},"Stop the service: in ",[207,360,361],{},"Services",", ",[207,364,365],{},"Chemistbook",[207,367,368],{},"Stop",[231,370,371,372,375,376,195,379,382],{},"Move ",[219,373,374],{},"C:\\ProgramData\\Chemistbook\\data\\chemistbook.db"," aside, and any ",[219,377,378],{},"chemistbook.db-wal",[219,380,381],{},"chemistbook.db-shm"," beside it. Keep them: they hold what was done since the backup.",[231,384,385,386,198],{},"Copy the restored file to ",[219,387,374],{},[231,389,390],{},"Start the service, sign in, and check the last sales and the stock.",[189,392,393],{},"Everything comes back as it was at the time of the backup: users, catalogue, batches, sales, the audit trail. Sales made after it are not in it; they have to be entered again from the receipts.",[189,395,396],{},"On a new PC, install Chemistbook first, then do the same.",[200,398,400],{"id":399},"try-it-once-a-quarter","Try it once a quarter",[189,402,403],{},"A backup that has never been restored is a hope. Every three months, and after every update, restore the newest backup from the USB drive into a scratch file as above, and keep what it says with the licence folder: the records it found whole, and their seal.",[200,405,156],{"id":406},"updates",[189,408,409],{},"Nothing changes on the PC until someone changes it: Chemistbook does not look for updates and does not download anything. An update is a new installer, run as an administrator when the owner decides. It:",[354,411,412,415,422,429],{},[231,413,414],{},"stops the service;",[231,416,417,418,421],{},"copies the shop's records to ",[219,419,420],{},"C:\\ProgramData\\Chemistbook\\before-update\\chemistbook.db",", replacing the copy from the update before, and changes nothing at all if it cannot;",[231,423,424,425,428],{},"replaces the program in ",[219,426,427],{},"C:\\Program Files\\Chemistbook",", and keeps the records, the backups and the settings;",[231,430,431],{},"starts the service, which brings the records up to the new version as it starts.",[189,433,434,435,198],{},"It asks nothing: the settings from the first install stay. Then sign in, make a sale and void it, print a receipt, open yesterday's figures, and press ",[207,436,209],{},[189,438,439,440,443],{},"Check the installer before running it: compare its SHA-256 (",[219,441,442],{},"Get-FileHash"," in PowerShell) with the one published with it.",[200,445,447],{"id":446},"going-back","Going back",[189,449,450],{},"If the new version will not start, or is wrong in a way the shop cannot work around:",[354,452,453,456,462,471,474],{},[231,454,455],{},"Stop the service.",[231,457,371,458,461],{},[219,459,460],{},"data\\chemistbook.db"," aside and keep it: it holds what was sold since the update.",[231,463,464,465,468,469,198],{},"Copy ",[219,466,467],{},"before-update\\chemistbook.db"," to ",[219,470,460],{},[231,472,473],{},"Run the previous installer.",[231,475,476,477,198],{},"Sign in and check the last sales and the stock look as they did before the update, then press ",[207,478,209],{},[189,480,481],{},"Records made after the update are not in the copy from before it; they have to be entered again. Going back without step 3 is not safe: the new version may have changed the records in ways the old one does not expect.",[483,484,485],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":303,"searchDepth":310,"depth":316,"links":487},[488,489,490,491,492],{"id":202,"depth":316,"text":151},{"id":285,"depth":316,"text":286},{"id":399,"depth":316,"text":400},{"id":406,"depth":316,"text":156},{"id":446,"depth":316,"text":447},"How Chemistbook backs itself up and copies each backup off the PC, how a backup is put back, and how an update goes on and comes off again.","md",null,{},"\u002Fdocs\u002Fsetting-up\u002Fbackups-restore-and-updates",{"title":181,"description":493},"1.docs\u002F7.setting-up\u002F3.backups-restore-and-updates","D5L9Z7vScr-sn33TpXFO6XB0Sc1maKBVr1kAxaEKXtU",[495,495],1791653129976]