Import & Export
Complete guide to NkapBooks Import & Export — the Import Wizard for bulk CSV data import, the Export Wizard for data export (CSV/JSON), report exports, PDF document export, and automatic daily database backups.
13. Import & Export
NkapBooks provides comprehensive tools for importing data into and exporting data out of the application. The Import Wizard supports bulk CSV imports with column mapping and validation, the Export Wizard lets you export any list view to CSV or JSON, reports can be exported directly, and the Backup Manager handles automatic daily database backups to the NkapBooks server.
| Component | Location | Description |
|---|---|---|
| Import Wizard | Setup → Import Wizard | Bulk import data from CSV files with column mapping, validation, and error reporting |
| Export Wizard | List View → Export button | Export any document list to CSV or JSON with field selection |
| Report Export | Reports → Export | Export any financial or inventory report to CSV/PDF |
| PDF Export | Document → Save as PDF | Export individual documents (invoices, quotes, etc.) to PDF |
| Database Backup | Automatic / Manual | Automatic daily backup to NkapBooks server with manual backup option |
Ctrl+K). The Export Wizard appears when you click Menu → Export Data on any list view. Report exports are available from the toolbar of each report page. Database backups run automatically every 24 hours for Pro/Enterprise users.13.0 Import & Export Overview
NkapBooks handles data movement through four distinct mechanisms:
┌──────────────────────────────────────────────────────────────┐
│ 1. Import Wizard (CSV → Documents) │
│ Bulk create documents from structured CSV files │
├──────────────────────────────────────────────────────────────┤
│ 2. Export Wizard (Documents → CSV/JSON) │
│ Export list views with field selection and filters │
├──────────────────────────────────────────────────────────────┤
│ 3. Report Export (Reports → CSV) │
│ Export any report directly from the report toolbar │
├──────────────────────────────────────────────────────────────┤
│ 4. Database Backup (SQLite/PostgreSQL → Server) │
│ Automatic daily backup with server-side retention │
└──────────────────────────────────────────────────────────────┘
Key Principles
- Offline-first — All import/export operations work without an internet connection (except server backup uploads)
- Non-destructive — Imports create new documents; they never overwrite existing records
- Validated — Imports go through multiple validation stages (column mapping, cell validation, link checking) before data is committed
- Flexible — Export any combination of fields in CSV or JSON format
13.1 Import Wizard
The Import Wizard allows you to bulk-create documents from CSV files. It supports all major document types and handles both simple (flat) and complex (parent + child table) schemas.
Importable Document Types
| Document Type | Examples | Has Child Tables |
|---|---|---|
| Item | Product catalog migration | ✗ |
| Party (Customer/Supplier) | Customer and supplier lists | ✗ |
| Sales Invoice | Historical invoice data | ✓ (items) |
| Purchase Invoice | Vendor bill migration | ✓ (items) |
| Sales Quote | Quote migration | ✓ (items) |
| Payment | Payment records | ✗ |
| Journal Entry | Opening balances, adjustments | ✓ (accounts) |
| Account | Custom chart of accounts | ✗ |
How to Access
- Sidebar: Navigate to Setup → Import Wizard
- Command Palette: Press
Ctrl+K(orCmd+Kon macOS) and search for "Import Wizard" - Direct URL: Navigate to
/import-wizardin the app
Import Flow
The complete import process follows these steps:
┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌────────────┐
│ 1. Select │───▶│ 2. Upload │───▶│ 3. Map │───▶│ 4. Review │───▶│ 5. Import │
│ Doc Type │ │ CSV File │ │ Columns │ │ & Validate│ │ & Report │
└────────────┘ └────────────┘ └────────────┘ └────────────┘ └────────────┘
Step 1: Select Document Type
When you open the Import Wizard, the first step is selecting the type of document you want to import:
- Click the document type dropdown at the top of the page
- Select from the list of available schemas (e.g., Item, Party, Sales Invoice)
- The wizard automatically loads the schema definition and builds the available field list
Step 2: Upload CSV File or Add Rows Manually
You have two options for getting data into the wizard:
Option A — Upload a CSV file:
- Click Select File in the header toolbar
- Browse to your
.csvfile and select it - The wizard parses the CSV and attempts to auto-map columns based on header names
- Data rows appear in the grid below
Option B — Add rows manually:
- Click the + (Add Row) button in the header
- Empty rows appear in the grid
- Fill in values directly in each cell
Step 3: Map CSV Columns to Document Fields
After uploading a CSV, the wizard shows a mapping interface:
| UI Element | Description |
|---|---|
| Column Header Dropdowns | Each CSV column has a dropdown to select which document field it maps to |
| Auto-Mapping | The wizard automatically matches CSV column headers to field names/labels |
| Column Picker | Click Pick Columns to choose which fields to include/exclude |
| Required Fields | Fields marked as required are highlighted and must be mapped |
| Duplicate Detection | The wizard warns if the same field is mapped to multiple columns |
Column Picker Dialog:
The column picker groups fields by schema:
- Main document fields — Direct fields on the parent document (e.g.,
name,date,party) - Child table fields — Fields in child tables (e.g.,
items.item,items.quantity,items.rate) - Required fields — Checked by default and cannot be unchecked
Auto-Mapping Logic:
When a CSV is loaded, the wizard scans the first row for header labels and tries to match them against:
- Field labels (display names)
- Field names (technical names)
- Schema-qualified labels (e.g.,
SalesInvoiceItem.item)
Step 4: Review and Validate
Before importing, review the data grid:
| Validation | Description |
|---|---|
| Cell Errors | Cells with invalid values are highlighted in red. Hover to see the error message. |
| Required Fields | If a required field column has no value in a row, it shows an error |
| Link Validation | The wizard checks that all Link field values (e.g., customer names, item names) exist in the database |
| Duplicate Columns | Warning banner appears if the same field is assigned to multiple CSV columns |
| Missing Required | Warning banner lists any required fields that haven't been mapped |
| Option Fields | For fields with predefined options (dropdowns), the wizard validates that values match available options — it can match both the value and the label |
Error Banner:
At the top of the grid, an error message appears if:
- Duplicate column mappings exist: "Duplicate columns found: Customer, Item"
- Required fields are missing: "Required fields not selected: Date, Party"
Step 5: Import and Report
When validation passes:
- Click the Import button (blue primary button)
- A confirmation dialog shows the number of rows to import
- The wizard processes rows one by one:
- Converts raw CSV values to proper document values using the
Converter - Creates a new document (
Doc) for each row - For child tables, groups rows by parent name and pushes child entries
- Saves (and optionally submits) each document
- Converts raw CSV values to proper document values using the
- A progress indicator shows the current status
- After completion, a summary report shows:
- ✓ Successful imports — List of document names created
- ✗ Failed imports — List of failed rows with error details
Import Actions Menu
The More dropdown menu provides additional actions:
| Action | Description |
|---|---|
| Save Template | Download a blank CSV template with the correct column headers for the selected document type |
| Clear File | Remove the uploaded file and reset the grid |
| Pick Columns | Open the column picker to add/remove fields |
| Add Row | Add a new empty row to the grid |
CSV Template
The Save Template action generates a downloadable CSV file containing:
- Row 1: Schema labels (e.g.,
Sales Invoice,Sales Invoice Item) - Row 2: Field labels (e.g.,
Customer,Date,Item,Quantity) - Row 3: Field keys (technical names like
party,date,items.item,items.quantity)
This template serves as a reference for preparing your import data in any spreadsheet application.
Handling Child Tables
When importing documents with child tables (e.g., Sales Invoice with line items):
- Parent rows are identified by having a unique value in the
namecolumn - Child rows share the same parent
namebut have different child table values - The wizard automatically groups child rows under their parent
Example CSV for Sales Invoice:
| Name | Customer | Date | Item | Quantity | Rate |
|---|---|---|---|---|---|
| SINV-001 | Acme Corp | 2024-01-15 | Widget A | 10 | 25.00 |
| SINV-001 | Widget B | 5 | 50.00 | ||
| SINV-002 | Beta LLC | 2024-01-16 | Widget C | 20 | 15.00 |
In this example:
SINV-001has two line items (Widget A and Widget B)SINV-002has one line item (Widget C)- The customer and date only need to be specified on the first row for each parent
Option Field Handling
For fields with predefined options (Select/AutoComplete), the importer accepts both:
- Values (e.g.,
Male,Female) - Labels (e.g., the translated display label)
The importer maintains a label-to-value mapping and automatically resolves labels to their correct values during import.
Tips for Successful Imports
- Always start with the Save Template action to get the correct column structure
- Ensure Link field values (customers, items, accounts) already exist in the database before importing
- For large imports, test with a small subset first (5–10 rows) to verify mapping
- Use the cell error highlighting to identify and fix issues before importing
- Date fields should use
YYYY-MM-DDformat for best compatibility - Currency fields should use plain numbers without currency symbols (e.g.,
1250.00not$1,250.00)
13.2 Data Export
The Export Wizard allows you to export data from any list view in NkapBooks to CSV or JSON format with full control over which fields are included.
How to Access
- Open any list view (e.g., Sales Invoices, Customers, Items)
- Click the Menu (⋮) button in the list header
- Select Export Data
- The Export Wizard panel opens
Export Wizard Interface
The Export Wizard provides three configuration sections:
Configuration Options
| Option | Description | Default |
|---|---|---|
| Use List Filters | Apply the current list view filters to the export | ✓ Enabled |
| Export Format | Choose between CSV and JSON output | CSV |
| Limit | Maximum number of rows to export (blank = all) | No limit |
Field Selection
The field selector shows all fields organized by section:
- Main Fields — Direct fields on the document (e.g., Name, Date, Status, Amount)
- Table Fields — Child table fields grouped by table name (e.g., Invoice Items, Payment References)
- Checkboxes — Each field has a checkbox to include/exclude it from the export
- Table toggle — Checking a Table field enables its child field checkboxes
A counter at the bottom shows the total number of selected fields: "12 fields selected".
Export Formats
| Format | Description | Best For |
|---|---|---|
| CSV | Comma-separated values file | Spreadsheet applications (Excel, Google Sheets, LibreOffice Calc) |
| JSON | JavaScript Object Notation | Developer integrations, data analysis, programmatic processing |
Export Process
- Configure options (filters, format, limit)
- Select the fields you want to export
- Click Export
- Choose a save location in the file dialog
- The file is saved and a success notification appears with an option to Open Folder to locate the file
File Naming
Exported files are automatically named using the pattern:
{document-type}_{YYYY-MM-DD}.{extension}
Examples:
sales-invoice_2024-01-15.csvcustomer_2024-01-15.jsonitem_2024-01-15.csv
13.3 Report Export
All reports in NkapBooks support direct export to CSV format.
Supported Reports
| Report | Export Fields |
|---|---|
| General Ledger | Date, Account, Party, Debit, Credit, Balance, Reference |
| Profit & Loss | Account hierarchy with period columns |
| Balance Sheet | Account hierarchy with asset, liability, equity sections |
| Trial Balance | Account, Opening, Debit, Credit, Closing balances |
| Stock Ledger | Date, Item, Batch, Location, Quantity, Rate, Value |
| Stock Balance | Item, Location, Opening, In, Out, Balance, Valuation |
| GSTR-1 | Invoice details for GST filing |
| GSTR-2 | Purchase details for GST filing |
How to Export Reports
- Navigate to any report page (e.g., Reports → General Ledger)
- Configure filters (date range, accounts, parties, etc.)
- Click the Export button in the report toolbar
- Choose a save location
- The report data is saved as a CSV file
Report PDF Printing
In addition to CSV export, reports can be printed or saved as PDF:
- Click Print on the report toolbar
- The report opens in a print preview
- Use your system print dialog to save as PDF or send to a printer
13.4 PDF Document Export
Individual documents can be exported to PDF using the print template system. This is covered in detail in Section 12: Print & Templates, but here is a quick summary:
Supported Documents for PDF Export
| Document Type | Default Template |
|---|---|
| Sales Invoice | Invoice template |
| Sales Quote | Quote template |
| Purchase Invoice | Purchase Invoice template |
| Payment | Payment template |
| Journal Entry | Journal Entry template |
| Shipment | Shipment template |
| Purchase Receipt | Purchase Receipt template |
| Stock Movement | Stock Movement template |
| Inventory Adjustment | Inventory Adjustment template |
| POS Session | POS Session summary template |
PDF Export Flow
- Open any supported document
- Click Print → Save as PDF (or use the keyboard shortcut)
- Choose a save location
- The document is rendered using its assigned print template and saved as a PDF file
13.5 Database Backup
NkapBooks includes an automatic Backup Manager that handles daily database backups to the NkapBooks server. This ensures your financial data is safely stored off-device in case of hardware failure or data loss.
Architecture
The Backup Manager operates through the Tauri (Rust) backend:
┌────────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ Backup Manager │───▶│ Tauri Backend │───▶│ NkapBooks │
│ (TypeScript) │ │ (Rust Commands) │ │ Server │
│ │ │ │ │ │
│ • Scheduling │ │ • export_database │ │ • Store backup │
│ • Status tracking │ │ _backup │ │ • One per customer│
│ • Error handling │ │ • upload_database │ │ • Auto-replace │
│ │ │ _backup │ │ old backups │
└────────────────────┘ └──────────────────┘ └──────────────────┘
How It Works
- Startup: When the app starts and a database is connected, the Backup Manager begins
- Initial Check: After a 30-second delay (to let the app finish loading), it checks if a backup is due
- Periodic Checks: Every 1 hour, it checks whether 24 hours have passed since the last successful backup
- Export: If a backup is due, the Rust backend exports the database:
- SQLite: Copies the
.dbfile - PostgreSQL: Performs a SQL dump
- SQLite: Copies the
- Upload: The exported file is uploaded to the NkapBooks server with metadata
- Retention: The server retains exactly one backup per customer — each new backup replaces the previous one
Backup Metadata
Each backup upload includes metadata for identification and troubleshooting:
| Field | Description |
|---|---|
customerId | Unique identifier (instance ID or device ID) — used as the server-side key |
customerName | Company name from SystemSettings |
dbType | Database type (sqlite or postgresql) |
dbName | Database filename |
deviceId | Device fingerprint |
platform | Operating system (Windows, macOS, Linux) |
appVersion | NkapBooks version number |
countryCode | Country code from SystemSettings |
Backup Status
The Backup Manager tracks its operational status:
| Status Field | Description |
|---|---|
lastBackupTime | Timestamp of the last successful backup |
lastBackupSuccess | Whether the last backup attempt succeeded |
lastBackupError | Error message if the last attempt failed |
isRunning | Whether a backup is currently in progress |
nextCheckIn | Seconds until the next scheduled check |
Manual Backup
In addition to automatic backups, you can trigger a manual backup:
- Navigate to Settings
- The backup status shows the last backup time and next scheduled check
- Click Backup Now to trigger an immediate backup
Database File Access
For advanced users, the database file can also be accessed directly:
| Database Type | Location |
|---|---|
| SQLite | The .db file is stored in the app's data directory. You can copy this file manually for backup purposes. |
| PostgreSQL | Use standard PostgreSQL tools (pg_dump) to create backups of your database. |
The database file location is shown in the Database Selector screen when you select or create a database.
Backup Scheduling Constants
| Constant | Value | Description |
|---|---|---|
| Check Interval | 1 hour | How often the manager checks if a backup is due |
| Backup Interval | 24 hours | Minimum time between automatic backups |
| Startup Delay | 30 seconds | Delay before the first check after app startup |
| Retention | 1 per customer | Server retains exactly one backup per customer ID |
Backup Availability
| Tier | Automatic Backup | Manual Backup |
|---|---|---|
| Community (Free Trial) | ✗ | ✗ |
| Pro | ✓ | ✓ |
| Enterprise | ✓ | ✓ |
13.6 Data Migration Tips
Migrating from Another Accounting System
When migrating from another accounting application, follow this recommended order:
- Chart of Accounts — Import your account structure first
- Parties (Customers & Suppliers) — Import all customer and supplier records
- Items — Import your product/service catalog
- Opening Balances — Use Journal Entries to set opening balances for all accounts
- Historical Invoices — Import past invoices if needed for reporting continuity
- Payments — Import payment records linked to the imported invoices
Data Preparation Checklist
Before importing data:
- Export data from your source system in CSV format
- Ensure all linked records exist (e.g., create customers before importing invoices that reference them)
- Standardize date formats to
YYYY-MM-DD - Remove currency symbols and thousand separators from numeric fields
- Verify that option field values match NkapBooks dropdown options
- Test with a small sample (5–10 rows) before doing the full import
- Back up your database before large imports
Common Import Errors
| Error | Cause | Solution |
|---|---|---|
| "Value does not exist" | A Link field value (e.g., customer name) doesn't exist in the database | Create the linked record first, then retry the import |
| "Required field missing" | A required column has no value | Ensure all required columns have values in every row |
| "Duplicate columns" | The same field is mapped to multiple CSV columns | Remove duplicate mappings in the column header dropdowns |
| "Invalid value" | A cell value doesn't match the expected field type | Check that dates are in YYYY-MM-DD format, numbers are plain digits, and option values match the available choices |
| "Name already exists" | A document with the same name already exists | Use unique names or let NkapBooks auto-generate names by leaving the Name column empty |
13.7 Quick Reference
Import Wizard Keyboard Shortcuts
| Shortcut | Action |
|---|---|
Ctrl+K / Cmd+K | Open command palette → search "Import Wizard" |
Import Wizard Actions
| Action | Location | Description |
|---|---|---|
| Select Document Type | Dropdown at top | Choose which document type to import |
| Select File | Header button | Upload a CSV file |
| Add Row | Header button (+) | Add a new empty row |
| Save Template | Header button | Download a blank CSV template |
| Pick Columns | More menu | Choose which fields to include |
| Import | Primary button | Start the import process |
Export Wizard Actions
| Action | Location | Description |
|---|---|---|
| Open Export | List view → Menu → Export Data | Open the Export Wizard |
| Toggle Filters | Checkbox | Use/ignore current list filters |
| Select Format | Dropdown | Choose CSV or JSON |
| Set Limit | Number input | Limit exported rows |
| Select Fields | Checkboxes | Choose which fields to export |
| Export | Primary button | Save the exported file |
Summary
| Feature | Format | Direction | Requires Internet |
|---|---|---|---|
| Import Wizard | CSV → Documents | Inbound | ✗ |
| Export Wizard | Documents → CSV/JSON | Outbound | ✗ |
| Report Export | Reports → CSV | Outbound | ✗ |
| PDF Export | Documents → PDF | Outbound | ✗ |
| Database Backup | Database → Server | Outbound | ✓ |
The Import & Export tools in NkapBooks ensure you can always get your data in and out of the application efficiently. Whether you're migrating from another system, sharing data with your accountant, or ensuring disaster recovery with automatic backups, NkapBooks has you covered.