Skip to Content
@hammim-in/collbot-client 0.1.17 is released 🎉
Database Import & Export

Database Import & Export

The Invoice Application allows you to import and export your data, which can be useful for backing up your information, transferring data between different instances of the application, or sharing data in specific formats. The process for importing and exporting data might vary slightly depending on the platform you are using (Electron.js, Chrome Extension, React Native).

Electron.js Desktop Application (NeDB)

In the Electron.js version of the Invoice Application, each main module (Categories, Brands, Customers, Products, Inventories, Invoices) stores its data in a separate database file using NeDB. These files are typically located within the application’s data directory on your computer.

Exporting Data

While the application might offer a more user-friendly interface for exporting, understanding the underlying file structure can be helpful. Here’s a general approach:

  1. Navigate to the Module: Open the specific module from which you want to export data (e.g., Categories, Brands, Products).
  2. Look for an Export Option: On the listing page for the module, there might be an “Export” button or a similar option (e.g., under an “Actions” dropdown).
  3. Select Export Format: If prompted, choose the desired export format. Common options include:
    • CSV (.csv): Comma Separated Values, a widely compatible format for spreadsheets.
    • JSON (.json): JavaScript Object Notation, a format suitable for data interchange and often used by web applications.
  4. Initiate Export: Click the “Export” button to start the process. You will usually be asked to choose a location on your computer to save the exported file.

Example (Conceptual - Your Application’s UI might differ):

On the “Products” listing page, you might find a button that says “Export Products”. Clicking this could then give you options to export as “CSV” or “JSON”.

Importing Data

Similarly, you can import data into each module. Ensure the data you are importing is in the correct format (usually the same format as the export option provides, e.g., CSV or JSON).

  1. Navigate to the Module: Open the module where you want to import data.
  2. Look for an Import Option: On the listing page, find an “Import” button or a similar option.
  3. Select File to Import: Click the “Import” button. A file dialog will appear, allowing you to browse your computer and select the file you want to import (e.g., a .csv or .json file).
  4. Initiate Import: Once you have selected the file, click “Open” or “Import” to begin the import process.
  5. Review Import Status: The application will usually provide feedback on the import process, indicating whether it was successful or if any errors occurred.

Important Considerations for Electron.js (NeDB):

  • Separate Files: Remember that Categories, Brands, Customers, Products, Inventories, and Invoices are likely stored in distinct NeDB files. Therefore, you will need to export and import data for each module separately.
  • File Location (Advanced Users): For advanced users who want to directly access the NeDB files, these are typically located in a folder specific to your application within your user profile’s application data directory. However, it is generally recommended to use the in-app import/export functionality to avoid data corruption.

Chrome Extension (Chrome Local Storage)

Data for the Chrome Extension version is typically stored in the browser’s local storage. Importing and exporting data in this context might involve:

  • Using Browser Developer Tools: You might need to use the Chrome Developer Tools (usually accessible by pressing F12) to inspect and potentially extract data from the “Application” tab under “Local Storage”. Exporting this data would likely involve copying it as JSON. Importing might involve manually setting values in the local storage, which is generally not recommended for non-technical users due to the risk of data corruption.
  • In-Extension Functionality (If Implemented): The extension itself might provide specific import and export options within its user interface. Look for these options within the extension’s settings or on the module listing pages. Refer to the extension’s specific documentation for details.

React Native (SQLite)

In the React Native mobile app, data is stored in a local SQLite database on your device. Importing and exporting data directly from the SQLite database is generally more complex and typically involves:

  • App-Level Backup/Restore: The most common way to manage data in a mobile app is through backup and restore mechanisms provided by the operating system (iOS or Android) or specific features within the app itself (if implemented by the developer).
  • No Direct File Access: Unlike the desktop application, you usually cannot directly access the SQLite database files on a standard mobile device without rooting or jailbreaking.
  • Potential In-App Import/Export: The React Native application might include specific import and export functionalities within its settings or module listing pages. Check the app’s user interface for such options. If available, they will likely handle the complexities of interacting with the SQLite database.

Please refer to the specific import and export options available within each platform’s user interface. This documentation provides a general overview, and the exact steps might vary based on the application’s design. If you have trouble finding these options, please consult the application’s help section or contact support.

Last updated on