← Back to the blog

A restored database is a snapshot: what does not appear in the backup is not thereby proven never to have existed

A database restored from a backup is a picture of a scope and a moment: not finding a record in it shows that the record is not in that file, not that it never existed.

A restored database is a snapshot: what does not appear in the backup is not thereby proven never to have existed

System migrations are generally uneventful: one day the vendor changes. The problem shows up months later, when someone needs a document issued in the previous system and cannot find it in the new one. The most common explanation is "it wasn't in the backup". That is a true or false statement about a file, and nothing more.

A database export is an operation with a scope and a cut-off date: it covers certain schemas, certain tables, up to a certain moment. The resulting file, when restored, rebuilds that picture and nothing else. If the export was partial, if it was made before later issuances, if part of the content was in another schema or another system, the picture will not show them. The export log is the document that records what was done, and its absence makes the file harder to interpret.

In the anonymized case, two files were delivered to the expert. The first had a log, which made it possible to identify the system and version, build a compatible environment and restore it successfully. The second, created later and without a log, could not be opened. With the first one restored, queries were run by issuer name, along with a sweep of every text and date column for the invoice numbers. Nothing was found. The last record located predated the file's date by about a year.

This finding has at least four possible readings, and none can be asserted without more data: the invoices were not issued; they were issued and deleted; they were issued in a period or schema the export did not cover; or they are in the second file or in the source system itself. The expert's work documents what the queries returned and states what could not be examined, including the second file.

As regards the retention of tax documents, tax legislation requires them to be kept until the tax credits become time-barred (art. 195, sole paragraph, of the CTN, the Brazilian National Tax Code). The question of liability for the loss or absence is a legal one and lies outside technical scope. What the expert delivers is delimitation: what the file contains, what it does not contain and what could not be verified. For the lawyer, the useful expert questions are: what was the scope and cut-off date of the export; are there other files; is the source system still accessible; are there issuance logs outside the database.

A backup is evidence about itself. Before asking "where is the invoice?", ask "what did this file cover?". The answer defines what the absence means.

6 min read Translated from the original in Portuguese. Read the original →
← Back to the blog Go to the home page