← All guides

Rebuilding a corrupted POS offline database: when and how

Troubleshooting · 6 min read · By Dex Carter · Published 2026-10-26 · Last updated 2026-10-26

A POS terminal beside a cracked database cylinder with a wrench leaning on it and a backup disk in front
The cracked database is not the first question, whether the till holds unseen transactions is.

Direct answer: before choosing any repair, answer one question, does this till hold transactions head office has never seen? Every recovery path is safe for a till whose sales have all replicated up. Every path is dangerous for a till holding unsent transactions, and they are dangerous in different ways. One more honesty note up front: LS publishes no offline-database corruption or rebuild procedure of its own in its help. What follows combines the LS-specific backup behaviour that is documented with established SQL repair practice and the ordering another retail POS vendor publishes, flagged where each piece comes from.

Direct answer: first find out if the till holds unseen transactions

An offline database exists so the till can keep trading without a connection. That strength is the recovery problem: the newest transactions may exist only in that database. So the first step is not a repair tool. It is establishing whether replication is current, whether head office already holds everything the till has sold. If it does, the offline database is a copy, and even the most destructive option loses nothing but time. If it does not, the unsent transactions are the thing every option must be judged against, and preserving them outranks getting the till open quickly.

Option A: continue or restore, the Update Service backup decision

If the corruption surfaced around an update, LS's Update Service has already made part of this decision for you. When the Update Service updates a Business Central instance it creates a backup of the current database first, database.bak, and deletes it on successful installation. If installation and rollback both fail, the backup remains on disk, and the documented position is that the user must resolve it manually and remove the backup to try again.

The same troubleshooting guidance carries the warning that decides this option: if the POS device is still operational after the failure, it could contain new transactions or data, so continuing with the current database may be the right choice. Read that as a fork. Restoring database.bak returns the till to its pre-update state, clean, known, and missing everything traded since. Continuing with the current database keeps the transactions but keeps whatever state the failed update left behind. The backup's existence is not an instruction to use it.

Option B: repair in place. CHECKDB grades and when to stop

Repairing the existing database is the only path that even attempts to keep unsent transactions where they sit. The established SQL pattern for a corrupt log file is illustrative: the log can be rebuilt with ALTER DATABASE ... REBUILD LOG after taking the database offline, followed by DBCC CHECKDB to verify consistency. Note the order, repair first, then a consistency check as the verdict on whether the repair produced a database worth trusting.

Know the grades before you start. Both REPAIR_ALLOW_DATA_LOSS and REBUILD LOG can result in data loss; restoring from a backup does not lose data the same way. So in-place repair is not one option but a slope: repairs that promise to keep data are worth trying on a till with unsent transactions, and the moment the only remaining repair level is one that allows data loss, the decision changes, you are now choosing which transactions to sacrifice, and that choice should be made deliberately, with the affected period identified, not discovered at the next statement.

Option C: rebuild fresh, new offline database and re-replication

The clean-slate option: set the corrupted database aside, create a fresh offline database, and let master data replicate down again so the till starts from a known good state. Nothing in the corrupted database carries over, which is exactly the point when corruption is extensive or a repair's result cannot be trusted, and exactly the cost when the till holds unsent transactions, because those do not carry over either.

Because LS publishes no procedure for this in the sources behind this guide, treat a fresh rebuild as a partner-level job, not a store-level improvisation: the corrupted database is preserved untouched until head office confirms nothing in it is needed, and the rebuilt till does not trade until its data is verified (see Aftercare). What the rebuild buys is certainty, a database whose entire history is replication from a healthy source.

Head-to-head: time, data loss, and trust for each path

PathUnsent transactionsTrust in the resultChoose it when
A, restore database.bakLost: everything since the backupHigh, a known pre-update stateThe till traded nothing head office lacks, or the current database is unusable
A, continue with current databaseKeptDepends on what the failed update left behindThe POS is operational and holds new transactions
B, repair in placeKept at no-loss repair levels; at risk under REPAIR_ALLOW_DATA_LOSSOnly as good as the CHECKDB verdict afterwardsUnsent transactions matter and corruption looks limited
C, rebuild freshLost unless recovered from the old database firstHighest, entirely re-replicated dataCorruption is extensive, repair failed, or replication is confirmed current

Another retail POS vendor's published ordering points the same way: run the rebuild/compact-level maintenance first, then a structure-repair utility, and restore a backup last, noting that a restored backup loses everything entered since it was taken, and that even restored data should be checked with the maintenance utility before use. Least destructive first, restore last. The exception is the fully replicated till: when head office already has every transaction, jump straight to the option with the highest trust, because the data-loss column no longer applies.

Aftercare: verify totals against HO before the till trades again

  1. Keep the corrupted database untouched and offline until head office confirms it holds nothing unrecovered, it is the only evidence of the affected period.
  2. Confirm replication has caught up on the recovered or rebuilt database: master data present, no pending replication errors.
  3. Compare the till's transaction totals for the affected period against what head office holds. Success looks like: the totals match, or every difference is an identified transaction with a name and a value, never an unexplained gap.
  4. Run a consistency check (DBCC CHECKDB on a repaired database) and keep its result with the incident record.
  5. Only then return the till to trading, and watch its first statement closely for the period that spans the incident.

Caution: two of the paths above can destroy sales data that exists nowhere else. If the till holds transactions head office has never seen and nobody on site can identify the affected period with confidence, stop and escalate to your LS partner before running any repair or restore.

, Dex Carter, Tech Writer

IndexBack to all guides →