Backups and database health
Copy your database somewhere safe, check it for problems, and keep it fast.
Everything RKCoders POS knows lives in one SQLite database file in your Windows user profile, under AppData. Products, sales, customers, shifts, ZATCA documents — all of it, in one file.
That is convenient, and it means one thing above all: if you lose that file and have no copy, you have lost your business records.
Taking a backup
Open Settings and use the backup tool. Choose where to write the copy and it writes one.
The critical part is where it goes. A backup sitting on the same hard disk as the original protects you against a mistake but not against the disk failing, the machine being stolen, or ransomware. Send it somewhere else:
- A USB stick or external drive kept away from the till.
- A cloud-synced folder such as OneDrive or Google Drive.
- Another PC on the network.
Two copies in two places is the minimum worth having.
How often
Daily, as part of closing up. It takes seconds and it caps how much you can lose at one day’s trading.
If daily is unrealistic, weekly is far better than nothing — but be honest with yourself about how much a week of lost sales history would actually cost you to reconstruct.
Restoring
Restoring means putting the backup file back where the database lives. If you are recovering onto a new machine, install the app first, let it create its folder, then replace the database file with your backup.
Test this once, deliberately, on a spare machine or before you go live. A backup you have never restored is a hope rather than a plan, and the moment you need it is the wrong moment to discover the file was empty.
Health check
Settings has a database health check. It looks for corruption and structural problems.
Run it if the app has started behaving strangely: figures that do not add up, screens that will not load, errors appearing in the crash log. Run it too after a hard power cut or after the machine was switched off at the wall while the app was open, which is the usual way a SQLite file gets damaged.
If it reports a problem, restore your most recent good backup rather than carrying on and hoping.
Optimise
The optimise tool compacts the database and rebuilds its internal indexes. Over months of trading a database accumulates slack, and screens like Documents and Reports gradually get slower.
Run it every few months, or whenever things feel sluggish, and always outside trading hours. Take a backup first, as you should before any maintenance.
Things that will not lose your data
Worth knowing, so you do not worry about the wrong things:
- Installing a new version over the top. The installer does not touch the database.
- Uninstalling. It deliberately leaves your data behind.
- A licence expiring. The app stops letting you in; it does not delete anything.
Things that will
- A failed disk with no off-machine backup.
- A stolen or lost PC with no off-machine backup.
- Ransomware encrypting the drive, including any backup on the same drive.
- Someone deleting the AppData folder while “cleaning up”.
Every one of those is survivable with a copy somewhere else. None of them are without one.