Start with a question the restored records must answer
Pick one task that someone must still be able to do after leaving the tool. For a repair shop, that might be “Open job 0007 and list the parts used on it.” Use the question to choose the files and fields. Accept the export only after another person can answer it in an empty destination using the files and written instructions.
A report grouped by month may answer a sales question and still omit the job identifiers that connect parts to repairs. If your goal also includes recovering attachments, permissions, or application settings, name each one and design a separate check. Record any exclusions on the first page of the export instructions.
Specify the files before choosing the download format
- Write down the records in scope, the filter, and the export time with its time zone. When records can change during the export, use a consistent snapshot or pause writes for the test. Record how the two files represent the same point in time.
- Give every record a stable key. In a second file, use that key to identify the parent record. Describe each column, its type, unit, allowed values, and what a blank means. Treat identifiers with leading zeros as text from the start.
- For flat tables, specify the CSV encoding, delimiter, quoting, and header row. For nested records, a documented JSON structure may be easier to restore. Choose a representation for missing and deliberately empty values when the difference matters. The default Python CSV writer turns
Noneinto an empty field. One option is a separate presence column. - List the expected file names, record counts, and format version in a short manifest. Include only the fields the recipient needs. If linked files are required, list their relative paths and how to check them. Keep exports in an approved location with access limited to their intended users.
Worked example with two fictional repair jobs
Juniper Bench Repair is fictional. Its export includes jobs and parts. Job IDs and line IDs are text. Quantity is a positive whole number. In this example an empty parts list is valid. The manifest specifies two jobs and two part lines. Both files use UTF-8 CSV with a comma delimiter and a header row.
| File | Key | Fields in the export | Check after restore |
|---|---|---|---|
| jobs.csv | 0007 | Hinge repair | Two part lines belong to this job. |
| jobs.csv | 0010 | Inspection only | This job exists with zero part lines. |
| parts.csv | L01 | Job 0007, hinge, quantity 1 | One hinge on 0007. |
| parts.csv | L02 | Job 0007, screw, quantity 4 | Four screws on 0007. |
Changing L02’s job to 0010 leaves both file counts correct. It also points to a real job, so a check for broken links will pass. Only the comparison with the expected job-to-part pairs catches this mistake. Changing the same reference to 0099 produces a different failure because that job does not exist.
Run the restore where a mistake is reversible
- Start with an empty test destination. Turn off messages and other external actions. Give the tester just the candidate export, its manifest, and its instructions.
- Load the jobs and then the parts. Confirm the header, types, record counts, and unique keys. Inspect the stored job IDs directly to check that the leading zeros survived.
- Check every part links to a job. In SQLite, with the relationship declared in the schema,
PRAGMA foreign_key_checkreturns one row per broken constraint. In a spreadsheet, match the parent ID on each part against the job key column and flag unmatched or duplicate parents. - Compare the restored relationships and quantities with the answer key. Open 0007 and 0010 individually. Record the result of the wrong-parent and missing-parent tests on separate copies. Reject a package that changes the meaning of a record, even when all counts match.
Keep a restore worksheet with the export
Export version, scope, snapshot time and zone: Task the restored data must support: Files, columns, types, null rules and exclusions: Key in each file and referenced parent key: Expected counts, IDs, relationships and values: Empty destination and import order: Correct sample / wrong existing parent / missing parent: Pass or fail, discrepancy, owner and retest date:
If the file fails before records can be read, use the CSV encoding and delimiter guide. If the records load but a relationship changes, keep the original package and fix the mapping before running the restore again. For help specifying an export, bring a fictional example and the question the restored data must answer to an Internal Tools fit call.