Skip to content
·~3 min read

Backups and Data Security ​

OmniCraft ERP is architected as sovereign, offline-first desktop software. Your database, bills of materials, cost formulas, and financial balances reside strictly on your local computer, eliminating data leaks to third-party cloud infrastructure.

Local data sovereignty guarantees uninterrupted operation without an internet connection, yet demands disciplined stewardship of your storage. To protect your business from drive crashes, ransomware, or operating system failures, the software features a multi-tiered automated and manual backup engine.


Automatic Shadow Backups ​

In the background, the application executes a generational archive rotation strategy (Grandfather-Father-Son). Snapshot generation runs asynchronously, introducing zero user interface latency and never interrupting the craftsman's calculations.

1. Startup Backups ​

Upon every launch, OmniCraft ERP inspects the system calendar. When a new accounting cycle begins, the engine packages a lightweight snapshot of the workspace ecosystem without media files:

  • Daily Snapshot (auto_daily.zip) — created upon the first application start of the current day.
  • Weekly Snapshot (auto_weekly.zip) — records the state of your books at the beginning of each calendar week.
  • Monthly Snapshot (auto_monthly.zip) — preserves a benchmark snapshot on the first day of every month.
  • Yearly Snapshot (auto_yearly.zip) — long-term archive for annual financial reviews and tax preparation.

2. Application Shutdown Backups ​

When the craftsman exits the application, OmniCraft ERP immediately hides the main window and executes background maintenance:

  1. Index Optimization: Runs the SQLite PRAGMA optimize; command, updating internal query planner statistics to accelerate subsequent lookups without blocking I/O.
  2. Three-Slot Rotational Cascade: The application maintains a sliding trio of recent session exits — auto_close_1.zip, auto_close_2.zip, and auto_close_3.zip. Each time the application closes, older snapshots shift back by one position, preserving access to your last three active sessions.
  3. Temporary Asset Cleanup: An automated garbage collector purges temporary HTML label preview files and thermal print buffers.

3. Preemptive Safety Snapshots ​

Prior to executing any irreversible operational commands, the system forces an immediate shadow database backup:

  • Before initiating an «Accounting Reset» (clearing operational ledgers);
  • Before executing a «Factory Reset»;
  • Before automatic database schema migrations when upgrading to a newer software release.

4. Backup Storage Directory ​

All automated snapshots are stored in the application's secure operating system data path:

  • Windows: %APPDATA%\OmniCraft\backups\ (typically C:\Users\<User>\AppData\Roaming\OmniCraft\backups\);
  • Linux: ~/.config/OmniCraft/backups/.

Protecting Your Archive Directory

Configure automated synchronization between the local backups directory and an external drive or encrypted network share. In the event of catastrophic drive failure, you can restore your workshop in minutes.


Manual Data Export ​

To migrate data to a new computer, share books with an accountant, or generate a permanent offsite archive, navigate to «File» ➔ «Export Data...». The system provides two export formats.

1. Full System Backup (.zip) ​

Generates a compressed archive containing your entire workspace ecosystem. The modal export dialog allows craftsmen to selectively package specific components:

  • [x] Core Accounting Data — the primary omnicraft_erp.db database (raw materials, recipes, finished stock, orders, sales, and cash flow);
  • [x] Workspaces — isolated personal capital databases (workspaces/*.db) and the system registry workspaces.json;
  • [x] Photos and Media Files — catalog photos of raw materials, machinery, and finished goods;
  • [x] AI Knowledge Base & Skills — customized trade prompt manifest, learned rules, and specialized prompt templates;
  • [x] Chat History & Projects — assistant dialogue sessions stored in ai_context.db.

Every generated archive automatically embeds a backup_manifest.json descriptor in its root, containing schema versioning, checksums, and component metadata.

Fast Lightweight Exports

AI conversation logs are physically isolated within the dedicated ai_context.db database. Unchecking «Chat History & Projects» significantly accelerates compression, generating a compact archive file ideal for routine external storage.

2. Active Workspace Tables (.zip with CSV) ​

Selecting «Current Workspace Tables (.zip with CSV)» generates an exhaustive dump of all database tables from the active workspace as discrete comma-separated text files bundled into a single ZIP archive.

  • Independent Financial Audits: CSV files open directly in spreadsheet suites (Excel, LibreOffice Calc, Google Sheets) for external reconciliations, custom pivot reporting, or data analysis.
  • The Digital Parachute: If a binary database file ever suffers hardware-level block corruption and cannot be mounted, plain text CSV files can always be inspected in any text editor and restored line-by-line.

Data Restoration and Rollback Procedures ​

Recovery routines are accessed through the application menu via «File» ➔ «Import Data...» and «File» ➔ «Restore from Auto-backup...».

1. Restore from Auto-Backup (Time Machine) ​

Selecting «Restore from Auto-backup...» opens a chronological catalog of automated snapshots. Each recovery point is presented with its creation date, exact timestamp, and archive size:

  1. Select your target snapshot from the list («Program Exit (Latest)», «Daily Backup», or an archive from the preceding week);
  2. Click the restore button and confirm the action in the prompt dialog;
  3. The software unpacks the database, verifies integrity constraints, and performs a clean application reboot.

2. Selective Restoration from Backup Archives ​

Selecting «Restore System from Backup (.zip)» prompts the system to inspect the embedded backup_manifest.json file and display a selective restoration dialog:

  • Craftsmen can restore only material stocks and recipe catalogs while leaving current AI chat histories intact;
  • You can selectively restore personal capital databases without modifying commercial workshop registries;
  • The built-in validator inspects schema compatibility and rejects corrupted or alien archive files.

3. Binary Database Replacement (.db) ​

When supplying a raw SQLite database file with the .db extension (such as an exported omnicraft_erp.db), the system performs a safe file replacement, verifies table schemas, and reboots the application window cleanly.

4. Workspace Tables Import from CSV Archives ​

Selecting «Import Workspace Tables (.zip with CSV)» instructs the system to unpack the CSV files, purge existing tables in the active workspace, and systematically stream the records back into the database. Each data stream undergoes strict type validation, preventing syntax errors and foreign key mismatches.

Critical Rule: Imports Overwrite Existing Data

The restoration procedure does not merge records; it entirely replaces the current application state with the data from the backup file. Any transactions, sales, or configuration changes recorded after the creation date of the backup will be permanently lost. Always create a fresh manual export before restoring an older archive!


Engineering Reliability Under the Hood ​

Beyond scheduled backups, the OmniCraft ERP storage engine is engineered from the ground up to withstand sudden power outages and host system instability.

1. Write-Ahead Logging (WAL Mode) ​

All databases in the application operate under SQLite Write-Ahead Logging mode:

  • Any data mutation (recording a purchase order, logging a sale, or deducting materials) is first written atomically to a dedicated write-ahead log file.
  • Only after the log entry is safely flushed to the physical drive are changes committed to the primary database file.
  • Surviving Workshop Power Failures: If electrical power cuts out while a craftsman is recording a transaction, database corruption is prevented. Upon subsequent launch, SQLite automatically reads the log and either completes the commit or rolls it back cleanly to a valid state.

2. Atomic File Replacement and I/O Mutex ​

When background snapshots are generated, the engine protects the live database from concurrency conflicts:

  • Background operations synchronize through the file I/O mutex (WORKSPACE_IO_MUTEX), preventing simultaneous database writes during archive creation.
  • Snapshots are compiled into a temporary .tmp file and only swapped into the target path upon successful compression using the atomic system call os.replace.

3. Multi-Threaded Concurrency and Deadlock Protection ​

To eliminate lock contention between the user interface, background collectors, and AI assistant workers, the core applies robust database pragmas:

  • The connection busy timeout is extended to 5,000 milliseconds (PRAGMA busy_timeout = 5000;);
  • Strict relational integrity is enforced via PRAGMA foreign_keys = ON;;
  • Disk synchronization uses PRAGMA synchronous = NORMAL;, achieving a robust balance between throughput and physical durability.

Workshop Data Protection Standards ​

To ensure total security of your business records, adopt two fundamental operational habits:

1. The 3-2-1 Backup Strategy in Practice ​

  • 3 Copies of Data: Primary working database on your computer + automated snapshots in the application directory + regular manual offsite exports.
  • 2 Different Media Types: Your workstation's internal solid-state drive + an external portable drive or USB memory key.
  • 1 Remote Copy: An encrypted full system backup ZIP file uploaded to trusted cloud storage or a dedicated home server.

2. Migrating to a New Workstation in 3 Minutes ​

To transfer your entire workshop to a new computer without data loss:

  1. On the old machine, open «File» ➔ «Export Data...» ➔ «Full System Backup (.zip)» and select all components;
  2. Save the archive to a portable drive;
  3. Install OmniCraft ERP on the new computer and launch the clean program;
  4. Select «File» ➔ «Import Data...» ➔ «Restore System from Backup (.zip)» and choose your archive file;
  5. The application restores all workspaces, inventory, recipes, photos, and settings, rebooting immediately into your fully configured production environment.