Backup & Restore
Create manual backups, restore supported sections, configure automatic backups, and review recovery history.
What Backup & Restore is for
Backup & Restore protects important lab data before risky changes, imports, onboarding cleanup, training, or operational audits. It is not a replacement for infrastructure backups, but it gives lab owners and managers a practical way to export and restore the data areas they work with inside the Lab Panel.
Use this page when you need a controlled snapshot of catalog setup, prices, patient history, doctors, inventory, finance records, orders, instruments, QC data, or partner labs. Every section that appears in the Backup action can also be restored from a matching JSON or CSV backup file produced by Kashef.
Open Backup & Restore from Admin in the Lab workspace. Backups, restores, downloads, and restore uploads are scoped to the whole lab company, not to a single branch workspace.
Page areas
Backup Protection at the top tells you at a glance whether your data is safe: all data areas backed up, some needing a fresh backup, or nothing backed up yet. The bar shows how many of the ten data areas have a recent backup. Below it you see when the last backup finished, when the next automatic backup runs, how many backups passed the recovery check, and that every backup file is encrypted. When some areas need a backup, choose Back up N areas now to open a backup with those areas already selected. While a job is running, a notice shows how many are in progress and the page updates on its own.
Backup Insights lists each data area with its current record count, its status (Up to date, Needs a new backup, or Never backed up), when it was last backed up, and how many records changed since then. A check badge means the last file passed the recovery check. Choose Back up on a row to back up only that area.
Automatic Backup shows whether scheduled backups are on, the schedule (for example, every day at 02:00), which data areas are included, the next and last run, and how many backups are kept. Choose Set up automatic backups or Change schedule to edit it.
Backup history lists every backup, restore, and import with its type, data area, file format, restore mode, status, and who requested it. Filter it by type, data area, or status. Download finished backups, open View Error on a failed job, or delete a finished backup you no longer need. Running jobs cannot be deleted. Error details are shown only to users with the Backup & Restore manage permission because they may contain internal identifiers.
The Restore & import menu at the top holds Restore from a Kashef backup, Import from another system, and Download Tests Catalog Schema.
Creating a manual backup
Choose Back up now, select one or more data areas (or Select all), then choose the file format. JSON is the safest format for restore because it keeps structure clear. CSV can also be restored when it was generated by Kashef, including raw table snapshots for doctors, inventory, finance, orders, instruments, QC data, and partner labs. PDF is a readable report and should not be used as a restore source.
Catalog backs up test definitions (including culture tests), categories, lab units and the unit of each test, profiles, test packages, sample settings, parameters, reference ranges with their exact age limits, and related catalog structure. A PDF catalog backup lists each reference range with the gender and age it applies to, so you can compare it with your previous system's catalog. A JSON catalog backup is written in the same format as Import from another system, so you can restore it here or import it into another lab: categories keep their keys, tests keep their sections, rules and formulas, and prices keep their currency. Prices backs up catalog base prices, price lists, contracts, and discount rules according to the selected options. Patients backs up patient identity and can include order history and results. Partner Labs backs up every partner lab and branch partner with its contact details, partner type, accepted samples, pickup schedule, turnaround time, cost per test and contract rules, its test menu with partner codes, prices, requested specimen, tube, amount and assay time, its branch priorities, its partner portal users, and the special price list it uses.
Doctors, Inventory, Finance Records, Orders, Instruments, QC Data, and Partner Labs use structured table snapshots. JSON stores the structure directly. CSV stores each table row as table and row_json, so it is still restorable by Kashef, but it should not be edited casually in spreadsheets.
After starting the backup, the job is queued. Backup, restore, and reset jobs for the same company run one at a time to avoid conflicting writes or inconsistent snapshots. Keep working normally, then return to Backup history to download the completed file.
Queued means the backup is waiting for a worker or another company operation to finish; it does not mean the backup has failed. Cloud workers may take a little time to start. Wait for Completed and an available Download action before treating the file as a recovery point. If the status becomes Failed, ask a backup manager to review View Error in Backup history before creating another request.
Every generated JSON, CSV, and PDF file is encrypted with AES-256-CBC before it is written to the private backup disk. Kashef immediately decrypts the stored copy in memory, verifies its format, company scope, and section, and records its checksum before marking the job completed. The stored file remains encrypted; an authorized download is decrypted only while streaming it to the user. Failed jobs retry with bounded backoff, and final technical details stay in the restricted backup log rather than the notification.
Restoring data
Open Restore & import > Restore from a Kashef backup, choose the data areas you have files for, select the file type, choose a restore mode, and upload the matching file for each area. The last step shows each selected area with its last backup date so you can take a fresh backup first, then asks you to confirm. Restore uploads must use the selected .json or .csv extension and may be up to 12 MB. Each upload receives a private company-specific storage path and is deleted after the restore job succeeds or fails. Restore jobs run in the queue and appear in the log.
Update existing and add missing overwrites matching records with the file and adds new ones. Add missing records only keeps existing records unchanged and adds only the ones you do not have. Replace everything deletes the current data in the selected areas first, then imports the file. Use Replace everything only after taking a fresh backup and confirming that the uploaded file is the correct one.
When restoring Partner Labs, a partner with the same code, a partner test for the same test, or a portal user with the same email is updated instead of duplicated. With Replace everything, partners and portal users that are not in the file are removed, while those in the file keep their past orders, samples, transfers, and bills. Price lists are only added or updated, never removed; use the Prices section to replace them. A portal user whose email already belongs to another lab is skipped, and restored portal users stay signed out until they sign in again. If a partner test's specimen type or tube is not in the restoring lab's catalog, the test is restored without it; restore the Catalog first to keep those links.
Catalog, Prices, and Patients support JSON and CSV restore. Doctors, Inventory, Finance Records, Orders, Instruments, QC Data, and Partner Labs also support JSON and the Kashef-generated table CSV format. For those related-table sections, use files exported from Backup & Restore so IDs and relationships remain consistent. Kashef rejects generated JSON backups that identify a different lab company or section (a JSON catalog backup holds no lab identity, so it can move between labs), and table restores skip rows that would update records outside the current company.
Importing data from another system with an AI tool
Choose Restore & import > Import from another system on the Backup & Restore page. This action is available to users with restore permission and uses the same company scope, processing queue, and log as Restore.
- Choose one data type: Patients, Tests and catalog, Test base prices, Doctors, Inventory items, Suppliers, or Instruments.
- Copy the complete conversion prompt, or download it as a text file. Paste it into your preferred AI tool together with your original data. The AI tool can read PDF, CSV, XLSX, images, pasted text, or another format it supports. Only use an AI service approved by your lab for the information you are sharing.
- The AI must first ask whether to use Source only (extract supplied information) or Assisted completion (propose missing catalog information). Choose a mode and answer any questions about missing required fields before it prepares the file. In assisted mode, review and approve the proposed additions before it creates JSON.
- Save the returned UTF-8
.jsonfile and upload it here. Each file may contain up to 5,000 records and be up to 12 MB. Split larger imports into separate files. Keep each catalog profile with its component definitions, with child profiles before their parents. - Choose Insert missing records only to keep existing matches unchanged, or Update matches and insert missing records to apply the imported details. Updating patient details clears optional email or address values omitted from the file. Take a current backup before updating existing data.
- Continue to review the validated record count, compare the JSON with the original source, confirm your review, and choose Start import. Then check Backup history for completion and the created, updated, or skipped counts. Existing matches are skipped in insert-only mode.
The prompt contains the exact JSON envelope, accepted fields, types, date formats, enum values, duplicate rules, and instructions for the selected type. Kashef does not call the external AI service for you, and the generated prompt does not include existing patient records. You do not need an AI API key in Kashef.
Patient imports cover demographic details and require a real name and phone number. If either is missing, supply it before conversion; do not use invented values. Catalog imports cover tests, categories (test groups), lab units, parameters, reference ranges, profiles, test packages, shared sample types, tubes, units, requirements, processing settings, and supplied prices. Price imports cover base prices for test codes already present in your company; import the catalog first or provide the AI with your destination catalog export when codes differ. Doctors require a real email address. Items need a stable SKU, suppliers need a stable code, and instruments need a real serial number. These identify existing records; do not invent them to get past validation. New instruments remain inactive and offline until you configure their connections.
Catalog conversion builds each shared dependency once and links applicable tests to it. For example, tests using the same EDTA tube or the same fasting requirement reuse one definition. Distinct additives, sample types, unit scales, and fasting durations remain separate. Source-only mode leaves unknown optional details out and asks for missing required details. Assisted completion proposes additions for your approval; review collection and processing details against your lab protocols before use. Fields omitted from new definitions use Kashef defaults, so check tube settings before using them for collection. Omitted requirement links keep existing links; an explicit empty requirement list removes them when updating.
Catalog imports can also bring your lab structure. Categories are the test groups shown when ordering and on reports, such as Lipid Profile or Thyroid Hormones. Lab units are the departments that run tests and sign their results, such as Hematology or Microbiology; each test can be linked to one. Packages are offers that sell several tests or profiles at one price. Every test in a package must be in the file or already in your catalog. Packages the AI proposed rather than read from your source arrive inactive: check their tests and prices on the Test Packages page, then activate them. After importing lab units, add each unit manager's name and signature on the Lab Units page.
A catalog file can also set up tests with several results (such as Complete Urine Analysis, with its sections, list values and per-parameter formulas), calculated tests (such as LDL, VLDL, eGFR, HOMA-IR and risk ratios), the interpretation rules that write results comments, and the built-in CBC with its age-specific ranges. Each lab keeps its own test codes, so a ready-made starter catalog can be imported by any lab. After importing, everything stays editable from Catalog > Tests.
Source-confirmed prices are imported with the catalog, including supplied currency, minimum price, and validity dates. No separate price import is needed. When a price is unavailable, it must be omitted: updating leaves the existing price unchanged, while a new test has no imported base-price record and needs pricing before use. The AI must never invent prices, patient facts, clinical results, or reference ranges.
This guide imports item definitions; set opening inventory balances through the inventory workflow afterward. It does not convert linked order/result history, finance transactions, stock movements, or QC history. Use matching Kashef backup files with Restore for those sections. The guided external importer supports adding or updating records; it does not offer full-section deletion.
If validation fails, no import job is queued. Copy the reported errors back to the AI with the same prompt and complete JSON file, then upload the corrected file. Kashef checks the file again during processing. Validation catches format and supported-value problems, but you still need to verify that names, dates, prices, and clinical reference information were read correctly from the source. After a catalog import, download a PDF catalog backup and compare its reference ranges with the source list, paying attention to ranges split across pages, age groups, and Negative/Positive flags.
Automatic backups
For eligible lab companies without a schedule, the backup policy creates an enabled daily JSON schedule for all ten supported sections, uses the branch timezone, targets a 24-hour recovery point, and keeps 14 completed automatic files per section. The cloud scheduler checks every fifteen minutes and queues the first protection run immediately. Existing administrator-created schedules remain under administrator control.
Choose Change schedule on the Automatic Backup card to edit the recurring schedule. Turn it on or off, pick the data areas to include, choose Daily, Weekly, or Monthly with a run time, and set how many completed automatic backups to keep for each data area. Disabling the schedule requires acknowledging the resulting recoverability gap; existing files remain available but no new recovery point is created.
Daily runs every day at the selected time. Weekly runs on the selected weekday and time. Monthly runs on a day from 1 to 28 so the schedule is valid in every month. Automatic backups use JSON so they can be restored later.
The cloud scheduler checks due backup schedules every fifteen minutes. On a branch computer, Kashef Runtime checks them every five minutes; the local scheduler does not start a second backup run. A due schedule is claimed once before its jobs are queued. If automatic backups are not available for your lab, the schedule does not dispatch jobs and its next run is moved forward. A queued run is not a completed backup: check Backup Insights or Backup history for a completed, verified file, and use View Error in Backup history if a job fails.
A data area shows Needs a new backup when its latest completed backup is older than the schedule allows: one day for daily schedules, one week for weekly, and one month for monthly. Without a schedule, Kashef expects a backup at least once a day. The number of backups kept is counted per data area, not in calendar days.
Reset Data
Reset Data is the destructive companion to Backup & Restore. It permanently removes selected modules from every branch in the current lab company, or only from the branches you choose.
Only a Manager whose access role still grants Data Reset: Queue Destructive Resets can open the page or queue a request. A direct permission deny blocks the page even for a Manager.
The page follows three steps:
- Back up. Each module shows its record count and backup status (Up to date, Needs a new backup, or Never backed up). Choose Back up first to open Backup & Restore.
- Choose branches and modules. Under Choose branches, keep All branches or pick Specific branches and tick the branches to reset. Then select the modules to delete. The bar at the bottom shows how many modules, roughly how many records, and which branches you selected.
- Confirm. Choose Review and reset. The dialog lists each module with its record count and backup status, and warns you about modules without a recent backup. Confirm that you created and verified a current backup, type the exact English phrase
yes delete all, enter your own current password, then choose Delete data permanently.
When you reset Specific branches:
- Only Orders, Inventory, Finance Records, Instruments, and QC Data can be selected. Patients, Doctors, and Catalog are shared by every branch, so they can only be reset with All branches.
- Orders removes only the selected branches' orders and everything attached to them.
- Inventory removes the selected branches' warehouses with their stock, movements, receipts, supply requests, and transfers. Shared items and suppliers stay.
- Finance Records removes the selected branches' financial activity and cashier history, and clears the balances of accounts and cashboxes that belong to those branches. Shared company accounts keep their balance minus the removed entries.
- Instruments removes the selected branches' instruments. QC Data removes the selected branches' QC results; QC controls and targets stay.
- Other branches keep all their data.
Read what each module removes when you reset All branches:
- Patients removes company patient links, unshared patient records, their company orders with related refund requests and payer claims, portal visit requests, and loyalty records. A patient still linked to another lab company is preserved.
- Doctors removes company doctors and clears doctor references on existing orders.
- Catalog always removes tests and dependent results, prices, ranges, parameters, calculations, and mappings. Optional checkboxes also remove catalog foundations and microbiology setup. Removing foundations also clears the test requirement checks (such as fasting confirmations) recorded on existing orders and samples; the orders and samples themselves stay.
- Inventory removes items, stock levels, movements, suppliers, receipts, transfers, warehouses, and supply requests.
- Finance Records removes all company financial activity: transactions and entries, payments and collection requests, refunds, payer claims and their history, invoices and supplier bills, receipts, budgets, exchange rates, transfers, reconciliations, statement imports, and daily closures. It also removes every cashier shift, including active shifts, together with cash movements, counts, handovers, and variances. Account and cashbox balances return to zero. Existing orders remain, with their paid amounts cleared; accounts, cashboxes, categories, and payment methods remain available. After completion, refresh the Cashier page and start a new shift before collecting payments.
- Orders removes every company order with samples, results, payments, refund requests and their items, payer claims and their remittance and event history, invoices, attachments, feedback, home visits, and sample transfers.
- Instruments removes instruments and their test mappings.
- QC Data removes controls, targets, and QC result history.
Only one backup, restore, or reset operation can run for a company at a time. When another operation is queued or processing, Reset Data remains visible for review but Review and reset is disabled and the server rejects another request.
The Reset Operations Log shows the requesting manager, selected modules, the branches included, localized status, approximate queue progress, completion time, primary deleted-record counts, and a safe failure reference. Detailed database or filesystem exceptions are written only to protected application logs and are not exposed in the panel.
Before using Reset Data, create the matching JSON or CSV backups and verify that completed files can be downloaded. After completion, open each affected module and confirm the intended empty or retained setup. Use Restore with the matching files when the reset was performed for cleanup rather than permanent retirement.
Permissions and subscription access
Backup & Restore has separate permissions for managing technical details and the catalog schema, creating backups, restoring data, downloading backups, deleting finished backups, and managing automatic backup schedules. Any of these operational permissions can make the page available, but each action and download endpoint enforces its own permission. Give restore and backup-delete access only to owners, managers, or senior administrators who understand the operational impact.
Data Reset is stricter: the user must still have the Manager job role, the dedicated reset permission, current company membership, and a valid password at submission and processing time.
Manual backup and restore are part of your subscription plan. Automatic backups are a separate plan feature, so you can still create manual backups on a plan that does not include scheduling. If a backup option shows an upgrade notice, open Subscription to see which plan includes it.
Recovery checklist
Before restoring, confirm the data area, file date, lab company, and intended mode. Download a fresh backup of the current data before using Replace everything. Restore one section at a time when recovering from a complex issue.
After restore, check the affected page, Backup history, and Activity Logs. For catalog or prices, create a test order to confirm pricing and test lookup. For patients or orders, confirm samples and results still open correctly. For finance, reconcile totals before closing a shift.