﻿========================================================================
  MandiTally 2.0 Legacy Migrator  -  portable tool (graphical)
  Converts old "Mandi Tally 9.0" (VB6 / MS-Access .mdb) data
  into new companies in the modern MandiTally 2.0 app.
========================================================================

WHAT IS IN THIS FOLDER
----------------------
  Start Migrator.bat   <- double-click this to open the tool
  Migrate.bat          <- (same thing - opens the tool)
  README.txt           <- this file
  app\                 <- the program + bundled .NET runtime
                          (self-contained: no .NET install needed)
  You can also open the tool directly by running  app\BahiGstImport.exe


REQUIREMENTS (on the PC that runs the tool)
-------------------------------------------
  * Windows. That is all - there is NOTHING to download or install.
    The old .mdb files are opened with the 32-bit Access driver (which is
    why this tool is 32-bit). It uses whichever one the PC has, in this
    order:
        Microsoft.ACE.OLEDB.12.0     (comes with Office / Access)
        Microsoft.ACE.OLEDB.16.0
        Microsoft.Jet.OLEDB.4.0      (part of WINDOWS itself)
    The last one is on every Windows PC, so a machine with no Office and
    no Access still migrates perfectly well.
  * .NET is NOT required - it is bundled inside app\.

  If it ever says it cannot read the old data, check the answer first:

      Migrate.bat check D:\ManglaSoft
      (or)  Migrate.bat check D:\ManglaSoft\Comp1\2014-2015\MandiTally.mdb

  That lists every driver on the PC and what each one did with the file.
  Nothing is migrated. Usually a failure there means the .mdb is open in
  another program or is damaged - not that a driver is missing.


HOW TO USE (graphical window)
-----------------------------
  1) Double-click  "Start Migrator.bat"  (a window opens).

  2) LEFT side - OLD data:
       - Click "Browse..." and pick your old data root folder
         (e.g. E:\SFT\Bahi\9.0), or type it and click "Scan".
       - The grid lists every old company and each financial year
         it contains. Tick the company-years you want to migrate
         (use "Select all" / "None" to help).

  3) RIGHT side - NEW destination + type:
       - "New data folder": click "Browse..." and pick the MandiTally 2.0
         app's MT-DATA folder (where the app keeps its companies -
         by default an "MT-DATA" folder next to the app's .exe, or
         whatever Data Location the app is set to).
       - "Migration type": leave on "Typed" (recommended - full
         go-live with documents, registers, GST and stock). Other
         options: "Full" (ledger only) and "Opening balances only".

  4) Click the green "Start Migration" button.
       - Progress and a full summary stream into the black log box.
       - Each selected company-year becomes a new MT##### company.
       - A "reconciles=YES" line confirms the new books match the old
         ones to the paisa.

  5) Open MandiTally 2.0 -> Select Company -> pick the new MT##### company.


GOOD TO KNOW
------------
  * Non-destructive: the old .mdb files are opened READ-ONLY. Every run
    creates brand-new company folders (MT10001, MT10002, ...), so you
    can run it as many times as you like without any risk.
  * ONE company per old company: if you tick several financial YEARS of
    the SAME old company, they are all put into a SINGLE new MT##### company
    folder, each year in its own sub-folder (20172018, 20182019, ...) -
    exactly like the old data layout. The app opens the latest year by
    default; older years stay available under the same company.
  * Ticking years from DIFFERENT old companies creates one MT##### company
    for each of them.
  * Opening STOCK quantities are not carried in (the yearly .mdb has no
    opening-stock source), so Stock Balance shows the year's movements
    only. Ledger, party balances and GST are unaffected.
  * The old .mdb password is built into the tool.


ADVANCED - command line (optional)
----------------------------------
  The same program also runs headless from a Command Prompt:

    app\BahiGstImport.exe list    "E:\SFT\Bahi\9.0"
    app\BahiGstImport.exe typed   "E:\SFT\Bahi\9.0\Comp2" "2017-2018" "C:\MandiTally\MT-DATA"
    app\BahiGstImport.exe full    "<company>" "<YYYY-YYYY>" "<target MT-DATA>"
    app\BahiGstImport.exe company "E:\SFT\Bahi\9.0\Comp1" typed "C:\MandiTally\MT-DATA"
        (migrates ALL years of that company into ONE new company, year sub-folders)

  (Running the .exe with no arguments opens the graphical window.)
  Set MIGRATOR_LOG=<file> before a command line run to also write every
  progress line to that file (handy when the run has no console window).

  Cash book, journal, bank book and TDS entries of the old program are
  rebuilt entry by entry: each day's cash entries become that day's Cash
  Book, plain journal entries that day's Journal Book, and bank entries
  become Receipt / Payment / Contra vouchers on that bank account.


TROUBLESHOOTING
---------------
  "provider is not registered on the local machine"
        -> install the 32-bit Microsoft Access Database Engine
           (ACE OLEDB 12.0, x86).

  The window does not appear
        -> run  app\BahiGstImport.exe  directly; Windows SmartScreen
           may ask to confirm running a new program the first time.
========================================================================
