MIGRATION.md — from the myTextile Inventory System to this platform
Migration planning for the existing myTextile Inventory Management System – Unit 4 (job-work + trading modules) into the greige-fabric platform. This document is the planning layer for migration: it maps what we already know of the old data model, slices the migration per ROADMAP's S/B/H framework, lists the opening-balance items and the open questions. It is not the execution plan — execution happens per slice at build time (ROADMAP "How each phase is delivered"), and the hard constraints below bind every later step.
Companion docs: BRIDGE.md (the ONLY interchange mechanism — file-based), ARCHITECTURE.md §5 (parallel run & cutover), STATUS.md (standing buggy-source caveat), FIELDMAP.md (field inventory the mapping below comes from).
0. Hard constraints (binding — from the owner, rounds 22–26)
- File-based interchange only. No direct DB/API access to the old
software, no reverse-engineered credentials, no live links, no importer
that reaches into their running system. The ONLY path in is a file:
the owner's own backup file uploaded to
/upload-backup(lands inbackups/, gitignored), or any other file the old system can emit. - Read-only scraping. The backup is copied and scraped read-only; the file itself is never modified. Raw SQL/scripts are allowed ONLY in migration/extraction tooling (per repo rule), never as application code.
- Planning before building. No schema work, no production code from this document. Every migration slice is decided at the time (S/B/H), ground-tested, reconciled, signed — never whole-system-at-once (ARCHITECTURE.md §5.4).
- Nothing is decided here that is parked elsewhere. Valuation (FIFO/avg), numbering sequences, GST config, LTOL/UTL, cal-weight, grade pricing, "Booking Entries" meaning, reconciliation formats, D1 planning details — these are dependencies of cutover, listed in §7, not decided by this document.
- The old system's data is indicative. It is buggy and haphazardly built; every mapping below is verified against the real backup before any import runs (STATUS.md caveat).
1. Intake — how the old data reaches us
- Drop: https://trading.tynolabs.com/upload-backup (org login). Any
format, up to 100 MB; if the backup is a folder, zip it first and
upload the zip. Files land in
backups/(gitignored, never committed). - What to upload first (owner): the auto-save-after-session-close backup (not password protected) — a whole-DB copy is ideal; a sample backup is enough to start (§6 workplan).
- The scrape loop: copy file → identify format → enumerate tables/ sheets → map to the forms (FIELDMAP) → volumes/quality per table → produce the migration catalogue → feed §3/§4 of this document. All read-only; outputs are docs, never writes to the old file.
2. The old system as we know it today
From FIELDMAP.md (OCR of screenshots), the two decoded reports (REPORTS.md §2), and the Daily MIS workbook (16 sheets, Sep 2026). Indicative — confirm against the backup (§6).
2.1 Identity & shape
- myTextile Inventory Management System – Unit 4 — a per-unit (single-site) app with a FY header ("2026-2027"), Menu = Master / Transactions / Reports / Utility, logged-in user shown (UserName: Parag). Add/Edit/Save/Cancel/Delete/Browse toolbar — i.e. manual statuses and edit-in-place exist; the new system's append-only + status-axiom design is a deliberate departure.
- Two profit centres as two modules of ONE app: job-work (party material, conversion income) and trading (own material, fabric sale). The same physical events are typed in both → the duplicate-entry disease ARCHITECTURE.md §1 removes with one journal + two books.
- Utility menu = the transaction catalogue (FIELDMAP §0): Booking Entries · Sizing Register · Inward Beam · Inward Weft · Production Planning · Beam Card · Total Production Dept. · Inward Dept. · Total Packing Slip · Mending Dept. · Customer Bill · Folding Dept. · Payment Receive By Cheque · Rolling One-To-Many · Rolling Many-To-One · Yarn Return · Beam Return · I-Store · Inward/Outward Dept. · Weft Issue · Yarn Stock Transfer · Yarn Hishob Transfer · Yarn Physical Stock · Fabric Physical Stock · Cone To Be Issued · Yarn Hishob Difference · Daily Efficiency Register (1st/2nd shift).
- Planning workbook (screenshots/Daily_MIS-SEP-2026…xlsx) — the
shop's real planning data sits in Excel, sibling to the app:
Data(per-contract calc template + rows),Planning(1145 rows),Close Beam(6228),Beam Stock(951),Stiker,Under Sizing(beam outward details),Dispatch,Party Con. No.,Mending Checking report,Unit No.4(beam ledger 951 rows),Reed & cam Stock,Drawing plan,Design paper,Qaulity Chart,Sheet15(grey fabric inspection report). Question for owner: is this workbook app-generated or parallel manual entry (§8)? (Affects migrate vs retire.)
2.2 Document spine & numbering
| Old token | Meaning | New-model home |
|---|---|---|
| GP No | Goods-pass number — every movement's audit spine (also S.GP.No / PGP.No = sizer's/provider's GP) | gatepass / outward-inward movement ids |
| PS No / Slip No | Packing slip number | dispatch/packing header id |
| Booking No | Yarn purchase order number (trading) | yarn_po id |
| Contract No / C.No | Own contract no / party's contract no | order ids + party ref |
| Inward/Outward No | Movement document numbers | movement ids |
| Transfer Year | FY tag on every movement ("2026-2027") | accounting-period tag on events |
RollNo 433-07 |
Beam-scoped piece numbering (beam 433, piece 07) | roll register keyed by beam |
| Barcode No | Pre-printed barcode per bag/roll/bale | physical token id (QR in new system) |
Numbering continuity across modules (shared vs per-module) is a parked decision (FIELDMAP §10 q.17) — cutover depends on it (§7).
2.3 Ledgers & reconciliation artifacts the old system already has
- Yarn hishob (ledger per party, kgs; "Yarn Hishob Transfer" = ownership flips; "Yarn Hishob Difference" = variance) → the new yarn ledger + hishob-difference tile (REPORTS.md B-stage placements).
- Cal weight / cone math: bags × net-per-cone → totals; "cal wt" on every yarn movement; stock take counts non-zero / zero / difference cones → the new cone-balance model (BUSINESS.md B5 partial-cone reconciliation). Cal-wt formula = parked (FIELDMAP §10 q.5) — the backup data is where we prove the exact formula before importing.
- Winding reconciliation: empty bags/cones, ring wt, diff net/gr wt — the outsourced-spinner leg the new winding screen reproduces.
- Sizing receipt computes "Used kgs" (consumed at sizing) — sizing consumption basis, validated against the engine.
- Beam register across sheets: Beam outward (Under Sizing), inward (sizing receipts), Close Beam (6228 rows — historical beam-endings), Beam Stock, Unit No.4 ledger, Design paper (beam statuses) → feeds the beam entity + production history (what history rides over vs live state — §8).
- Per-contract hishob statement ("In/Out/Consumption", decoded REPORTS.md §2.1) — the format the new system generates at the contract (A6); its standard-rate consumption math (mtrs × engine per-mtr req) is the costing engine, not a separate dataset.
- Actual-vs-standard consumption (REPORTS.md §2.2) — the case for barcoded weft issue; in the new system this is a live tile at D2/D3, not a monthly report. (Reports/dashboards catalogue owned by the reports session — migration only needs the underlying events.)
2.4 Known cruft & drops (indicative — confirm in the backup)
- Double entry: same event in both modules (module toggle fields, "Jobwork Fabric" flags) — collapses to one journal (ARCHITECTURE §2).
- Manual status fields everywhere (Order Status, beam Status "Getting Frames"…) — replaced by workflow-derived statuses (DASHBOARDS §5.3).
- Less Meter / Less Taga — dropped (owner, round 2, PLANNING §5.7).
- N.PartyName — second party-name field; likely own-firm display (FIELDMAP §10 q.11) → a role/link, not a duplicate field.
- Excel-date serials (09 Aug → 03 Sep) in planning sheets — real dates in the new system.
- Sheet noise:
Data's top row is a calc template, not a record;Extra Print= print copy ofData;Sheet15is mostly the report title — extraction must skip template/print-duplicate sheets. - Old modules with no new-system equivalent survive as dumps at most (e.g. Payment Receive By Cheque → Tally-side, deferred); they are not rebuilt as forms.
3. Phased migration plan — per ROADMAP slice (S / B / H)
Decisions below are the planning default; each is re-ratified at the slice (ROADMAP "How each phase is delivered"). S = switch (build in new system, migrate records, retire in old), B = bridge (old stays owner, periodic file push into our import ledger, retirement date on it), H = hold. Brides are file-only (BRIDGE.md contracts).
| # | Slice (ROADMAP) | Old-system source | Plan | Notes |
|---|---|---|---|---|
| 0.1 | Masters — party | Master_Party (category, due days, broker, opening balance ₹, PAN/GST) | S | party_master; ₹ opening balance → Tally-side flag (not our stock). |
| 0.2 | Masters — yarn | Master_yarn (count, type Cotton/OE/Denier/Lycra) | S | yarn_master with count_system (Ne/denier). |
| 0.3 | Masters — quality/design | Master_Quality + Master_Design (width, reed, pick, counts, weave, alias, HSN, precomputed kg/m factors) | S | construction_master + quality alias; kg/m factors seed the conversion engine; HSN for Tally. UTL/parked fields carried but not interpreted yet. |
| 0.4 | Masters — loom & flange | Master_Loom (no, 3rd-shift toggle, 250/190), Master_Flange (no, beam size) | S | loom + flange; beam width derived from flange. |
| 0.5 | Conversion engine | kg/m factors + costing sheet (COSTING.md) | S (pure enablement) | Nothing migrates; factors seed defaults, verified by owner before engine locks. |
| 1.1 | PO / yarn booking | Yarn Booking (booking no, mill/ticket, count, bags×cone math, rate/kg, IGST/SGST/CGST breakup) | B first, then S | Open bookings bridge in (export = old app's print/dump); authoring switches after receipts stabilize on new system. GST config = parked. |
| 1.2 | Yarn stock ledger (own + party) | Yarn Physical Stock, hishob ledgers, cone balances, weft bags at looms/weavers | S — the heart | Opening balance cutover, printed + signed (§5). Old history does NOT ride over; stock state does. |
| 1.3 | Yarn movements | GPs / inward / outward / transfers (party↔factory, contract→contract, short, returns, sold weft) | S | Movement types map to typed events; "short yarn transfer" = shortage-adjustment event. B5 partial-cone reconciliation reuses cal/cone math. |
| 1.4 | SOs / orders | Fabric SO (mtrs, dispatch city, design, rate, CD%, brokerage, due days) + job-work contracts (beams-quantum, JobRate/picks, Rate) | B first, then S | Import open orders with balance; closed order history stays in the old system / archive dump. Amendments (Diff. Mtr./Beam) convert to amendment objects. |
| 1.5 | Requirement & allocation | (computed in old system? — confirm) | S | Only meaningful on new-system stock + SOs; nothing migrates. |
| 1.6 | Procurement suggestion | — | S (pure computation) | Nothing migrates. |
| 2.1 | Beams & WIP (warp/sizing) | Beam outward/inward, Under Sizing, Beam Stock, sizing receipts (ends, cut-mark, mtrs, cuts, used-kgs) | B / S mix | Live in-flight state migrates (beams at sizer, on floor); the 6,228-row Close Beam table rides as archive history, not live state. Out-house ledgers stay B during coexistence. |
| 2.2 | Weaving jobs / production | Production Planning (Further beam plan over machines), Daily MIS Planning sheet | B then S | Planning board is rebuilt (D1 details deferred); the sheet's rows seed the first plans, then the Excel retires. |
| 2.3 | Telemetry (efficiency register) | Daily efficiency register (1st/2nd shift, per-loom columns) | S | IoT-first: register becomes read-only live table (PLANNING §3.4); old rows import as archive/history only if needed. |
| 3.1 | Checking/grading + FG stock | Checking & packing registers (rolls + lumps), bales, Mending Checking report, Fabric Physical Stock | S | FG stock by grade = opening balance (§5); checking history stays old/archive. Grade letters (A/B/C/R/F…) — grade pricing parked. |
| 3.2 | Dispatch | Dispatch slips (PS no, copies, LR no, job-work toggle), bale dispatch slip, packing slip | S | New slip formats replace old prints (we design better, not copies — round 25); outstanding dispatch commitments migrate as open items. |
| 4.x | Samples & leads | (not in old system) | H / new | Greenfield; nothing to migrate. |
| 5.x | Weaver ERP pickup | (weavers' own ERPs) | B | Per BRIDGE/PLATFORM §7; format discovery continues (BUSINESS §6 q.4). |
| G | Tally hooks | Booking GST breakup, receipts, dispatch, job-work billing | B (later) | File/XML bridge per BRIDGE; GST config + valuation parked. |
Cutover shape (ARCHITECTURE.md §5): parallel run sliced per domain — new system live for new movements, old systems hold history; per-domain "old totals = new totals" reconciliation screens for N days; on sign-off the old module goes read-only then archive. Every B carries a retirement date written when created.
4. Data mapping — old → new (fields → entities)
Conventions as FIELDMAP.md: old field → new model home; drop = deliberately not carried (reason). Everything verified against the backup before import.
4.1 Masters
| Old (myTextile) | New | Drop / note |
|---|---|---|
| Master_Party: Party Name, Category (Party/Broker/Sizing/Transport), Address/Gate/Unit, City/Taluka/District/Pin/State, Mob/Phone/Email, Due Days, Broker Name, Opening Balance ₹, PAN, GST No | party_master (category type; credit days; broker link; GST/PAN) |
Opening balance ₹ → Tally-side opening (not fabric-system stock). |
| Master_yarn: Yarn Name "10S", Count 10, Type Cotton/OE/Lycra/150 DENIER | yarn_master (count, type, count_system Ne|denier) |
— |
| Master_Quality: Width, Reed, Pick, Warp/Weft count, Reed Space, Quality Name, Weave, Alias | quality (name/alias) → construction_master (versioned designs) |
Quality = sales name; design = construction snapshot (BUSINESS §4). |
| Master_Design: Design Name, quality alias, width, Pick-on-Loom, UTL, Reed Space, "As per checker", Reed, Warp Shrinkage %, HSN, yarn grid + kg/m factors | construction_master (width, reed, picks, counts, weave, shrinkage%, HSN) + engine seed factors |
UTL carried, meaning parked. kg/m factors seed COSTING defaults. |
| Master_Loom: Loom No, 3rd Shift toggle, 250/190, contract col | loom (no, shift matrix?, capacity class) |
3rd-shift meaning = open (FIELDMAP q.7). |
| Master_Flange: Flange No, Status, Beam Size 250cm | flange (no, beam size) |
beam.width derived from flange. |
4.2 Orders & commercial
| Old | New | Drop / note |
|---|---|---|
| Job-work sale contract (Contract No, C.No, Type of Loom, broker, brokerage%, payment days, Diff. Mtr./Beam tolerance; lines: Beam No, Quality, Meter/beam, JobRate ₹/pick, Rate ₹/m) | job_work_contract + lines (beam-qty, construction, mtrs/beam, jobRate, rate) |
Tolerance mode → amendment thresholds (round 2). Manual Order Status dropped. |
| Fabric SO (Order No, Party Contract No, Dispatch City, Design, Total Meter, Total Taga, Rate, CD%, Brokerage %, Due Days, Status) | fabric_so (mtrs; dispatch form rolls|lumps + per-piece mtr; cd/brokerage; amendments) |
Less Meter/Less Taga dropped (owner). Total Taga = lump count (~100 m pieces). |
| Fabric PO / outsourced weaving job-work order (type Jobwork Fabric, party = own Unit No.4, beams, design, meter, per-day, job rate, rate) | weaving_job on a unit (type flag) |
The "weaver is our own unit" = internal transfer (ARCHITECTURE §2), computed, not a second entry. |
| Broker/party payment pieces (Payment Receive By Cheque, Customer Bill) | H (Tally-side, later) | Not rebuilt here. |
4.3 Yarn (kgs)
| Old | New | Drop / note |
|---|---|---|
| Yarn Booking (Booking No, Delivery Date, Supplier, Owner, Broker, Count, Mill, Bags×WtPerBag×ConePerBag×Cones, WtPerCone, Gr/Net Wt, Rate/Kg, GST each head, Total) | yarn_po (booking no, supplier/mill/ticket, count, packaging math, rate, taxation rows) |
GST config parked; the booking's GST breakup is the Tally voucher seed. |
| Yarn Inward (Inward No, party, N.PartyName, broker, vehicle; rows per yarn count/bags/cones/qty) | yarn_receipt (inward no, booking link, lot no from GP, quantities) |
N.PartyName → role display. |
| Weft inward from job-work provider (GP/PGP No, party, transport/vehicle, contract; rows: yarn, R.Count, Lot No, Type, Bag/Cone, Ge.Wt, Net Wt, Set No, Cone Per Wt) | weft_receipt (lot 127333-xx = physical id; cone/bag units) |
Set-no moves to sizing/JW-beam inward per new rules. |
| Weft issue to production (Type of Issue, from/to set, loom, shift, payment mode; cones+kg) | weft_issue (production-only; loom+shift; cones) |
"Sold to party" type REMOVED (PLANNING §201) — sold yarn is a separate form, no billing hook on weft-issue. |
| Yarn return to party / saved-yarn transfer (party acct ↔ factory acct) / transfer contract→contract (incl. short yarn transfer) | yarn_movements: ownership flip / re-apportionment / shortage-adjustment events |
Append-only movement events. |
| Yarn physical stock take (Non-zero / Difference / zero cone) | stock-take events (cone balance) | Feeds hishob difference tile. |
| Yarn sent to weaver (weft out) / returned from weaver | weft_outward / return events (GP, contract, transport, vehicle) |
— |
4.4 Beams, sizing, winding, production (C/D)
| Old | New | Drop / note |
|---|---|---|
| Beam outward for sizing (Sizing Date, GP No, Sizing Name, party, transport, vehicle) | sizing_job (gpNo, sizer, transport, vehicle) + outward intimations |
Outward intimation → guard tap-out (round 19). |
| Beam inward from sizing (G.P.No, S.GP.No, warp count, cut mark mtr, meter, total ends, contract; per-beam: BeamNo, Meter, kg, sizer, Cuts, Quality, Width; totals) | beam register (ends, cut-mark, mtrs, cuts, computed kgs) + receipt events |
kgs validate the count factor (FIELDMAP §9.2). |
| Beams received from sizing + winding yarn received (Cutmark/lasa, Sizing-Set/Warping-Set No, issue bags/cones/net, Used kgs, weaver leg, AIRJET) | sizing-receipt (beams in + leftover/winding return) + weaver leg | "Used kgs" = sizing consumption basis. |
| Warping & Sizing Instruction Slip (tippan: tipan no, sizer, yarn issue rows, Ends per part × parts, Measure, Tasa/DBR, Quality, Beam instruction) | sizing_tippan (system propose → planner confirm) |
The verified ends-math (1504×9=13536) is the parts model. |
| Beam card (Beam No, Flange No, Sizing Set, contract, party, loom, warp/weft count, weave, cuts, total mtrs; rolls RollNo 452-01…; Kinari; frames) | beam card + piece/roll register | Tracking columns (beam→woven→shrinkage→card balance) from round 20. |
| Beam return to party (Set No, Party, GP, transport, vehicle; beam/mtr/kg rows) | beam_movements (party-owned beam return) |
— |
| Further beam plan over machines (per loom: planning/set/design/beam/flange/job rate, total/actual/remaining/per-day/on-loom/running + projected finish dates) | production_plan per loom |
D1 board details deferred; plan rows migrate as seed, Excel retires. |
| Daily machine production / Daily Efficiency Register (shift, session A/B/C, per-loom: RPM, total, on-loom, actual mtr, eff%, status, stops, warp/weft breaks + times, start attempts, electrical-failure min) | loom-telemetry events (IoT ingest; manual tap fallback) |
The register becomes a live table; old rows = archive-only. |
| Rolling One-To-Many / Many-To-One | roll split/join events | Mended/folded piece lineage. |
4.5 Checking, FG, dispatch (E/F)
| Old | New | Drop / note |
|---|---|---|
| Checking & packing register — rolls (Roll No beam-scoped, barcode, mtr, kg, kg/m, tag, grade cols, TOL/LTOL) | checking_rolls (grade buttons; measure + IoT) |
TOL/LTOL carried, meaning parked. |
| Checking & packing register — lumps + Converting lumps to bales (PS No, party, design, F grade, bale slip) | lump class + bale entity (bale barcode) |
Bale mode rules per round 12 (JW unbaled, trading baled, out-house bales in-system). |
| Dispatch slip (Firm, PS No, party, to-party, delivery address, design, bill no, rolls/barcode, transport, status Non-delivered, SDate, Job Work toggle) | dispatch (pre-slip plan → tap-load → final slip; copies office/transport/customer; LR no) |
Job Work toggle → computed module view. Manual status dropped. |
| Fabric Dispatch slip (packing slip no, purchase party, order no, balance qty, design alias, vehicle, tag nos, transport, LR no, copy checkboxes, Auto wate flag) | dispatch events + role-based print copies | "Auto wate" meaning = open q (verify in backup). |
| Fabric Inward from weaver (slip no, contract no, quality, roll/tag, mtrs, kg, kg/m) | fabric_in (weaver/unit contract) |
Slip no = weaver's packing slip ref. |
| Bale dispatch slip / bale insert slip | bale dispatch documents (round 25 templates) | We design better versions, not copies. |
4.6 Reporting/ledger artifacts
| Old | New | Note |
|---|---|---|
| Yarn Hishob / Transfer / Difference | yarn ledger (live) + hishob-difference tile (B-stage) | Ledger = statement (REPORTS.md B placement). |
| Job-work hishob In/Out/Consumption | per-contract hishob statement at A6 | Format owned by reports session (REPORTS §2.1); data = events. |
| Actual vs standard consumption | live D2/D3 consumption tile | Reports session owns the tile; events are ours. |
| Daily MIS workbook (16 sheets) | live boards/tiles + dumps (DUMPS.md) | Sheets retire as their tile goes live (dump loop); workbook migration = B/H pending owner's "app-generated?" answer (§8). |
5. Opening balances at cutover (one-time, printed + signed)
Per ARCHITECTURE.md §5.2: opening balances are cutover entries, printed and signed — they are the hand-over of trust from old to new. List (sources in brackets); each gets a reconciliation screen "old total = new total" before the old module goes read-only:
- Yarn stock own — kgs per yarn (count/type/ticket), per lot/set, with location (godown / sizer / weaver / in-transit) — from Yarn Physical Stock + hishob ledgers + cone balances + weft bags at looms/weavers. Also party yarn (job-work, on party account) — tracked, never valued (ARCHITECTURE §2).
- Open yarn Bookings (POs) — booking no, supplier, balance kgs to receive (old system's open/partial receipts).
- Open SOs — order no, party, design, balance mtrs (incl. per- grade split if already partially dispatched).
- Open job-work contracts — contract no, C.No, party, beam/mtrs balance, hishob state (pending/sent), tolerance mode.
- In-flight beams — beams outward at sizer (Under Sizing), sized beams on floor (Beam Stock), beams on looms (beam cards), per-beam mtrs/cuts/ends; flange registry.
- WIP — beams' woven-but-unchecked mtrs; rolls under mending/ checking; weft bags issued but unconsumed (cone balances per loom).
- FG stock by grade — rolls, lumps, bales (mtrs + kg), incl. stock at own Unit No.4 / weavers with location; valuation method parked (applies only after cutover for P&L).
- Yarn accounts — per-party hishob balances (yarn given vs returned/consumed), weaver saved-weft accounts, party loans (netted at close).
- Numbering continuation — next Contract/Booking/GP/PS/Inward/ Outward numbers at cutover (parked decision, §7).
- Party opening balances (₹) — from Master_Party; Tally-side only, flagged, not migrated into fabric stock.
Sign-off drill: each line above printed as a statement, staff-confirmed
(source tag = import <myTextile> + staff-confirmed, then behaves like
native data — BRIDGE.md trust rule), owner signs, old module → read-only.
6. Backup scrape workplan (what the sample backup will yield)
When a backup lands in backups/, the scrape produces the migration
catalogue (this doc §3/§4 get filled with evidence). First pass done
2026-09-03 — see §10 (format verdict, real table inventory, data
facts, and the export ask):
- Format & structure: identify the backup (SQLite/Firebird/Access/ zip…), list tables + columns + row counts; fingerprint the app version.
- Form → table map: every FIELDMAP form/menu → its table(s); reconcile old screen names ("Booking Entries", "I-Store", "Cone To Be Issued"…) with actual tables, and flag cruft (orphan/stale/test tables, print-copy tables) to skip.
- Volumes & quality: row counts + date ranges per table (determines migrate-live vs archive-only vs sample-only); blank/duplicate rates; the real FY span (is 2026-2027 the only FY or are older FYs present?).
- Numbering evidence: per-module series (shared vs split) — feeds the parked numbering decision.
- Formula proofs: cal-weight + cone math from actual rows; "Used kgs" derivation; LTOL/UTL population vs usage (observed only); "Auto wate" column.
- Config: GST per supplier (IGST vs SGST/CGST), rate fields, the design kg/m factors as stored.
- Excel-sheet ↔ tables: does the Daily MIS come from the app or parallel manual entry? (Answer decides migrate vs retire.)
- Secrets hygiene: verify no credentials needed (owner: backup is unzipped/unprotected); nothing from the file is committed — analysis outputs only.
Every finding lands in this document (tables in §3/§4 marked "verified
from backup
7. Migration dependencies — parked decisions the cutover needs
These are not decided by this document (owner-owned, parked per PLANNING §13 / rule 9). The migration plan blocks on them only at the points shown:
| Parked decision | Where it gates migration |
|---|---|
| Valuation method (FIFO vs weighted-avg) | Opening FG stock valuation + stock-mode COGS after cutover (REPORTS §5). |
| Numbering sequences (shared vs per-module) | Opening-balance line 9; continuity of Contract/Booking/GP/PS numbers. |
| GST config per supplier | Tally bridge (G) + booking import validation. |
| LTOL/UTL meaning | Checking-roll mapping (fields carried, uninterpreted). |
| Cal-wt formula | Yarn opening balance + movement kgs (proved from backup data first). |
| Grade pricing A/B/C/R/F | FG opening by grade (mtrs/valuation), seconds/bales valuation. |
| "Booking Entries" menu meaning | PO mapping confirmation. |
| Reconciliation formats (sizer/winder/weaver) | B-stage reconciliations after cutover. |
| D1 planning-board details | Production-plan import depth (Phase 2 slice). |
| Promise vs target-date definition | SO opening balances + due-position migration. |
8. Open questions for the owner
- Upload the sample backup to https://trading.tynolabs.com/upload-backup (zip the data folder if it is a folder; the auto-save file, unzipped/ unprotected, is fine). The scrape (§6) then fills the mapping with evidence.
- History depth: migrate only the live state + current FY, with older years archived (recommended), or full history? (Affects Close Beam 6228 rows, planning history, dispatch history.)
- Daily MIS workbook: is it generated by the myTextile app or is it parallel manual Excel? (Migrate vs retire; the sheets are already the planning board's source.)
- Numbering continuation at cutover (parked decision to be taken before Phase-1 slices go live).
- Party ₹ opening balances: migrate from Master_Party opening balance (Tally-side) or start clean and reconcile through Tally bridge?
- Parallel-run start point: after which Phase-1 slice does the first domain run in parallel (suggested: yarn stock ledger, the highest duplication-pain domain — per ARCHITECTURE §5.3/ROADMAP slice 1.2)?
- Old systems' end state: read-only → archive after each domain's reconciliation sign-off — confirm the archive expectation (keep the old machine/app reachable for lookups, or export + archive?).
- Weaver ERPs (BUSINESS §6 q.4): formats/names — needed before the Phase-5 B slice, not for Phase 0–1.
9. Sequencing & review cadence
- Now (planning): this document + the backup scrape as files arrive.
- At each build slice (ROADMAP): re-ratify S/B/H for that domain with the owner; build the slice with its dump and its reconciliation screen; ground-test N days; reconcile old vs new totals; sign off; old module → read-only; B bridges get their retirement date.
- Cutover is never whole-system: per domain, one owner at a time (ARCHITECTURE §5.4).
- Every change to this plan is logged in PLANNING.md (single log of record); this document never silently overwrites committed content.
10. Backup scrape — first-pass findings (2026-09-03)
File received at /upload-backup: 20260902-bc7c1f16-myTextile-Data-20260826-181752.zip
(53.6 MB zip → one file myTextile-Data-20260826-181752.bak, 392 MB raw).
Scraped read-only in a scratch copy; the original stays untouched in
backups/ (gitignored). All findings below are evidence, not decisions —
the standing buggy-source caveat applies.
10.1 Format verdict — SQL Server backup (NOT directly readable here)
file/header: Microsoft SQL Server backup (TAPE media set,RAID/SPAD/SFMB/SSETblocks; taken by thesalogin; media "osADMINISTRATOR").- Logical database:
MY_Textile(MY_Textile.mdf/_log.ldf), original physical fileC:\Program Files (x86)\Microsoft SQL Server\MSSQL.1\ MSSQL\Data\CB4Demo.mdf→ the app runs on 32-bit SQL Server (2005-era instance "MSSQL.1") on the Windows box, and the database was originally the vendor demoCB4Demo(the myTextile app is built on it). Backup date 2026-08-26 18:17. - Consequence: a
.bakis opaque without SQL Server; SQL Server does not run on this ARM Pi (and a heavy install is off-limits per the round 22–26 constraints). The ONLY practical intake remains file exports from the Windows box (§10.4) — this validates BRIDGE.md, not a new integration. The.bakis kept as the master record/archive and for later reference if the owner ever exports via SSMS. - What WAS readable read-only: object names + data fragments embedded in the database pages (SQL Server stores schema and data as pages; the system catalog and proc definitions are plain text inside). No credentials, no passwords, no connection strings were needed or extracted; only object names and business-value fragments.
10.2 Real table inventory (from PK/FK names + usp_BIND_* form bindings)
The app's forms bind through usp_BIND_* stored procedures — one per
screen. That gave the authoritative form → table map. Master group:
| myTextile table | Binds the form (FIELDMAP screen) | New-model home |
|---|---|---|
| CompanyMaster · FirmMaster | company/firm record ("CHARBHUJA UNIT NO.4") | tenant + unit (ARCHITECTURE §2) |
| ContactMaster · SupplierMaster | Master_Party (categories party/broker/sizing/transport via Contact) | party_master (category) |
| CityMaster · GodawoonMaster/Detail | city list · godown master | location master (godown/sizer/weaver) |
| QualityMasterMain/Detail | Master_Quality (width/reed/pick/counts/weave) | quality → construction |
| DesignMasterMain/Detail (FK ItemId) | Master_Design (design + yarn rows + kg/m factors) | construction_master + engine seed |
| FlangeMaster · LoomMaster (shiftId, LoomTypeId) | Master_Flange · Master_Loom | flange · loom (capacity class, shifts) |
| YarnTypeMaster · ItemMaster · ProductMaster · TypeNewMaster · ParticularMaster · SubHeadMaster · UnitMaster/UnitNewMaster · ShiftMaster · LoomTypeMaster · MonthMaster · YearMaster (2015–2027) | yarn types/items/units/shifts/FY | master sets + FY period tags |
| UserDetail · UserRightsForm · UserRightReports · MenuMaster · UserSession | login/roles/rights | better-auth roles (rebuild, no migration) |
| accountCategory/Group · accountLedger · accountVoucher(+Type/Detail) | accounts layer (see §10.3) | Tally-side, not rebuilt |
Yarn/commercial (B/A):
| myTextile table | Form (FIELDMAP) | New-model home |
|---|---|---|
| Booking · BookingEntriDetail · BookingQualityMaster · (BookingEntries*) | Yarn Booking — "Booking Entries" menu = this table family | yarn_po |
| POMain/PODetail · Gatepass(+pending/return) | PO · gatepass | yarn_po partial · gatepass entity |
| SOMain/SODetail · ServiceOrder | Fabric SO | fabric_so |
| YarnInwardMain/Detail · CompanyInwardMaterial(Detail) · CompanyOtherInwardMaterial(Detail) | Yarn Inward / inward dept | yarn_receipt + movement events |
| YarnOutwardMain/Detail · CompanyOutwardMaterial(Detail) · CompanyOtherOutwardMaterial(Detail) | outward / GP legs | outward events (intimation→tap) |
| YarnTransferMain/Detail | contract→contract / party→factory transfers | yarn_movements (+ short type) |
| YarnPhysicalStock · YarnHishobDifference(Main/Detail) · WeftConsumtionMain | Yarn Hishob Transfer/Difference · physical stock | yarn ledger + hishob-difference tile |
| InwardWeft(Main/Detail) · InwardWeftReturn(Main/Detail/Old) | Weft inward / weft return | weft receipts + returns |
| WeftIssue(Main/Detail) · WeftIssueDetailTmp · WeftReturn(Old) | Weft issue (types incl. sold-to-party) | weft_issue + sold-yarn hook |
| YarnFromWinding(Main/Detail) · YarnToWinding(Main/Detail) · ConeToBeIssued(Main/Detail) | winding legs + cone-to-be-issued | winding leg + cone balance |
| ClothPurchaseMain/Detail · OutwardBill(Main/Details) · otherBillMain | Fabric PO / outsourced weaving (own Unit No.4) | weaving_job + billing refs (Tally) |
| FabricPhysicalStock(Main/Detail) | Fabric Physical Stock | FG stock by grade/location |
| TagaTransferMain | taga/lump transfers | roll/taga movements |
| BaleSlip(Main/Detail) | bale slips (≈ bale dispatch/insert) | bale entity |
| MillStoreBilling/Payment(Main/Detail) · InwardMillStore · OutwardMillStore | I-Store = mill/general store | H (consumables ledger, not fabric scope) |
| CashPayment/CashReceive/ChequePayment · PaymentReceiveByCheque(Details) · accountVoucher* | payment receives / banking | Tally-side (G stage), not rebuilt |
Production spine (C/D/E/F):
| myTextile table | Form (FIELDMAP) | New-model home |
|---|---|---|
| SizingRegister(Main/Detail) · SizingReceipt(Main/Detail) | beam outward/inward from sizing | sizing_job + beam receipt |
| SizingTippen(+Detail) · WarpingTippen(+Detail) | warping & sizing instruction slip | sizing_tippan (system proposes) |
| InwardBeam(Main/Detail) · ReturnBeam(Main/Detail) · BeamCard(Main/Detail) | beam inward / beam return / beam card | beam register + beam card |
| ProductionDetailMain/Detail | Total production / production planning | production entries + plan board |
| DailyEfficiencyRegister(Main/Detail) | Daily efficiency register (1st/2nd shift) | loom-telemetry events (IoT) |
| RollingOneToMany(+Department) · RollingManyToOne(+Detail) | rolling one-to-many / many-to-one | roll split/join events |
| MendingDepartment · FoldingDepartment | mending / folding depts | mending/folding events (E) |
| OutwardPackingSlip(Main/Detail) | packing & dispatch slips | dispatch (pre-slip → final slip) |
| ElectrictyConsumption · OtherExpenses* · EmpAdvance/Attendance/Present/Salary* · IncentiveMaster* | mill expenses / payroll / incentives | out of fabric scope (ROADMAP) — archive |
Cruft / junk tables confirmed (skip at import): tmpbale,
tmpBalePackingSlip, tmpLocalpackingSlip, TMPPackingSlipDetail,
tmpSizingStock, XtmpLastYearBalance, WeftIssueDetailTmp,
InwardWeftReturn*Old, WeftReturnOld, PK_Table_1 (literal junk table),
usp_alldata, person-named report procs
(usp_rpt_ProductionPlanningSawant, OutwardPackingSlipBhoje,
...Hawal, ...Vadinge, ...mh09/FL4029-type variants) — the
incremental-build fingerprint the owner described. Also OPSMain
(+OPSDate) — acronym unknown, flagged to ask the owner.
10.3 Report-proc catalogue (evidence for the reports session)
120+ usp_rpt_* procedures exist — the old Reports menu as procedures
(BalePrint, BeamBook, BeamCard, Gatepass, InwardOutward*Partywise,
ContractYarnConsumation, DailyEfficiency*, FabricStock*,
ProductionPlanning, PurchaseOrder, SaleRegister, ServiceOrder,
YarnPhysicalStock, SetwiseHishobStatusReport, OutstandingReport,
ProfitabilityReport, ImportWithInventory, RequiredYarn,
WeftYarnReq…). The full list is in the backup catalogue; the reports
session can use it as the definitive "old Reports menu" index. Not
touched here (scope rule — reports/dashboards owned elsewhere).
10.4 Data facts learned (indicative)
- FY span 2015-16 → 2026-27 present in
YearMaster/rows — the DB carries ten+ years of history. Cutover decision (live state + current FY vs full history) matters even more: ruling on this before any export pass (§8 q.2). - Column-name spine: camelCase
…Id/No/Name/Date/Wt/Per/Amtcolumns (setNo,firmId,beamNo,billNo,netWt,millId,tagaNo,loomNo,igstPer/igstAmt/sgst*/*cgst*,disPer/disAmt,vehiNo,rollNo,baleNo,pieceNo,accountYearId,changeDate) — matches FIELDMAP screenshots field-for-field (GST breakup, taga rows, vehicle no…). - Values: dominant mill
SANATHAN(7,741 page refs); own unitsCHARBHUJA…present; hishob partyKEN ENTERPRISESpresent; banks (HDFC/Canara/Axis/ICICI/TMB) + payment modes (NEFT/RTGS/Direct/ Accounts) live in the accounts tables; machine+flange combos (MH09FL4029etc.) in rolling/planning rows; yarn types incl. Lycra/ denier tokens. - Parked-question evidence (not decided): "Booking Entries" menu →
the
Booking/BookingEntriDetail/BookingQualityMastertable family (yarn booking) — strong evidence for the owner's confirmation.
10.5 What is still NOT readable from the .bak (and how we get it)
The .bak gives object inventory + fragments, NOT: exact row counts,
column types, full column lists per table, or clean row-level extracts.
Per-table data for the opening balances (§5) and mapping verification
needs a readable export from the Windows box — pick the easiest:
- SSMS on the Windows machine → for each table in §10.2 (the ~40
kept ones, not cruft): Save Results As → CSV/Excel, or
bcp "MY_Textile.dbo.<table>" out file.csv -S . -T -c -t,— one export per table, zipped, uploaded to/upload-backup(any format). - Or SSMS Generate Scripts (data-only) per table →
.sqlfiles, zipped, uploaded. - Or if myTextile has a built-in Excel/data export per form, use it — the Daily MIS workbook shows one already exists.
Priority set for the first batch (opening balances + master mapping):
ContactMaster, SupplierMaster, QualityMasterMain/Detail,
DesignMasterMain/Detail, FlangeMaster, LoomMaster, YarnTypeMaster,
FirmMaster, CompanyMaster, GodawoonMaster/Detail, Booking… family,
SOMain/SODetail, Gatepass, YarnPhysicalStock,
YarnHishobDifferenceMain, CompanyOutwardMaterial(Detail) (current FY
only), InwardBeam/ReturnBeam/BeamCard (current FY), FabricPhysicalStock,
BaleSlipMain, WeftIssueMain. Everything else rides as archive.
10.6 Mapping status update
§3/§4 table names above are now schema-verified (2026-09-03) — the
screenshots→FIELDMAP names and the real MY_Textile tables match
cleanly; the drops/cruft list is confirmed from object inventory. Row
counts + column types pending the §10.5 exports.
11. Exact mapping to the built Phase-1 schema (2026-09-03)
The new system's foundation schema is live in
src/lib/server/schema-foundation.ts (24 tables). The old MY_Textile
tables (from §10.2) map onto it as follows — row counts/column types per
table pending a data export (§10.5/§12).
| MY_Textile (old) | New table (schema-foundation.ts) | Carry / drop |
|---|---|---|
| ContactMaster, SupplierMaster | party (category Party/Broker/Sizing/Transport/Weaver/OwnUnit) |
carry; openingBalance ₹ → Tally-side flag |
| FirmMaster, CompanyMaster | party (isOwnUnit) + tenantId/setupId seams |
carry (own units) |
| QualityMasterMain → DesignMasterMain, QualityMasterDetail/DesignMasterDetail (yarn rows) | design (qualityName/alias, width/reed/pick/counts, warpRows/weftRows JSON, warpKgPerM/weftKgPerM) |
carry → engine seed |
| YarnTypeMaster, ItemMaster | yarn (name/count/countSystem Ne|D/typeCode KW.CW…/ticket) |
carry |
| LoomMaster | loom (loomClass 250/190, loomType AIRJET, shifts) |
carry |
| FlangeMaster | flange (flangeNo, beamSize) |
carry |
| GodawoonMaster/Detail | lot.location + beam.location (godown/sizer/weaver/…) |
carry as values, not a table |
| Booking, BookingEntriDetail, BookingQualityMaster | booking (bookingNo, bags/conesPerBag/bagWt/perConeWt/net, ratePerKg, gstType/gstPct + igst/sgst/cgst amts) |
carry open bookings only |
| POMain/PODetail | booking (same shape) |
merge with Booking family |
| SOMain/SODetail | order (type=SO, rate, cdPct, brokeragePct, dueDays, dispatchCity, deliveryForm, perPieceMtr) |
carry open SOs with balance |
| ClothPurchaseMain | order (type=OUTSOURCE, party=own unit) |
carry open |
| Gatepass (+pending/return procs) | gatepass (kind YARN_IN/YARN_OUT/…, direction, source/target party, image, confirmToken, status intimated→confirmed) |
carry current-FY GP register |
| YarnInwardMain/Detail, CompanyInwardMaterial(Detail) | gatepass (YARN_IN) → lot (lotNo, owner own/party, warpWeft, bags/cones/gross/net/cal, status) |
opening stock = lot rows (§5.1) |
| YarnOutwardMain/Detail, CompanyOutwardMaterial(Detail) | gatepass (YARN_OUT) + movement |
carry current FY |
| YarnTransferMain/Detail | movement (kind contract_to_contract/party_to_factory/factory_to_party/short) |
carry |
| WeftIssueMain/Detail, InwardWeft(Main/Detail), InwardWeftReturn(Main/Detail) | movement (weft_out/return) + lot (cones consumed) |
carry current FY |
| YarnFromWinding/YarnToWindingMain | gatepass (WINDING) + movement |
carry |
| YarnPhysicalStock | lot (status/physical counts) |
opening balance extract |
| YarnHishobDifferenceMain/Detail | reconciliation (kind hishob/stocktake) |
opening variance items |
| ConeToBeIssuedMain | reservation/pending-issue queue |
defer |
| SizingRegister(Main/Detail), SizingReceipt(Main/Detail), SizingTippen, WarpingTippen | tippan + beam (setNo, sizingName, ends, cutMark, totalMtrs, status) |
in-flight sets/beams (§5.5) |
| InwardBeam(Main/Detail), ReturnBeam(Main/Detail) | gatepass (BEAM_IN/BEAM_RETURN) + beam |
in-flight beams |
| BeamCard(Main/Detail) | beam (loomNo, status floor/getting/onLoom/finished) + roll |
beam register |
| ProductionDetail(Main/Detail) | evt (production events) + beam.mtrProduced |
archive-to-events option |
| DailyEfficiencyRegister(Main/Detail) | evt (iot telemetry, later) |
archive |
| RollingOneToMany/ManyToOne, MendingDepartment, FoldingDepartment | roll (rollNo, mtrs/kg/grams, grade, defects, status WIP→FG) |
carry FG roll state |
| BaleSlip(Main/Detail) | roll (grade F/lump → bale grouping, future) |
carry lump stock |
| OutwardPackingSlip(Main/Detail) | dispatch_slip (psNo, orderId, partyId, transport/vehicle/lrNo, rollsJson, status) |
carry pending slips |
| FabricPhysicalStock(Main/Detail) | roll (FG stock by grade; location) |
opening FG balance |
| accountLedger/accountVoucher*/Cash*/Cheque*/PaymentReceiveByCheque | Tally bridge (G stage) | H — not migrated |
| Emp*/Payroll/OtherExpenses/ElectricityConsumption/MillStore*/IncentiveMaster*/tmp* | — | archive/drop (out of fabric scope) |
Notes: number continuity (Booking/Contract/GP/PS/Inward) and per-FY
tagging (accountYearId, YearMaster 2015→2027) are the summary sources
for the parked numbering decision; the old *Main/*Detail (header +
lines) split maps to the new single-table + JSON-lines pattern
(warpRows/weftRows, rollsJson, items).
12. Docker restore attempt — BLOCKED by kernel page size (2026-09-03)
Owner granted Docker use to try restoring the .bak directly. Attempted
and definitively blocked — not a fixable failure:
mcr.microsoft.com/azure-sql-edge:latest(SQL Server 2019 engine) does ship a linux/arm64 image — pulled (659 MB) and started on this Pi.- The server aborted instantly:
<jemalloc>: Unsupported system page sizeOut of memory allocating bitmask. This Pi runs with 16 KB memory pages (getconf PAGESIZE= 16384; kernel6.12.75+rpt-rpi-2712), and SQL Server's SQLPAL allocator requires 4 KB pages (all editions: full SQL Server, Azure SQL Edge, SQL Server 2025 — same engine constraint).
- Page size is baked into the booted kernel; no container/runtime/ userspace option changes it. Emulation paths were considered and rejected (qemu x86 full-system on 4 GB ARM = startup failure risk + impractical restore times; SQL Server's PAL does not behave under user-mode emulation).
Verdict: the .bak cannot be restored on this machine, Docker or
not. The restore is perfectly feasible on any 4K-page x86/ARM box or the
Windows machine itself. Consequences:
- Exports stay the intake — the Windows box (SSMS/
bcp) or a 4K-page machine with SQL Server can restore the.bakand export the tables; uploaded zipped to/upload-backup(§10.5). This remains the ONLY practical path and is consistent with BRIDGE.md file interchange. - The schema-grounded mapping (§11) is complete and needs only row counts/column types once exports land.
- The
.bakis retained untouched inbackups/as the archive record — it restores cleanly on the owner's machine (verified format is sound; logical DBMY_Textile, filesMY_Textile.mdf/_log.ldf, so anyone restoring shouldRESTORE … WITH MOVEto those names).
12.1 Follow-up (2026-09-03): unchanged — and what else the .bak gives
Re-checked after the docker attempt: page size still 16384, no new
uploads. The restore question stays no on this Pi. One further
read-only recovery was made from the .bak itself — per-table column
evidence from the foreign-key names (SQL Server stores them as plain
identifiers), confirming the column-level mapping without a restore:
| FK name | Table.Column (exact) |
|---|---|
| FK_CashPayment_VoucherId / LedgerId | CashPayment.VoucherId / CashPayment.LedgerId |
| FK_CompanyInwardMaterial_OutwardId | CompanyInwardMaterial.OutwardId |
| FK_CompanyOtherOutwardMaterial_InwardId | CompanyOtherOutwardMaterial.InwardId |
| FK_DesignMasterDetail_ItemId · FK_DesignMasterMain_QualityId | DesignMasterDetail.ItemId · DesignMasterMain.QualityId |
| FK_InwardBeamDetail_CompanyId · FK_InwardBeamMain_companyID | InwardBeamDetail.CompanyId · InwardBeamMain.companyID |
| FK_InwardDepartment_BeamcardMainId | InwardDepartment.BeamcardMainId |
| FK_InwardWeftMain_companyId / contactId | InwardWeftMain.companyId / InwardWeftMain.contactId |
| FK_LoomMaster_shiftId | LoomMaster.shiftId |
| FK_MendingDepartment_InwardId | MendingDepartment.InwardId |
| FK_OutwardBillMain_FirmKey | OutwardBillMain.FirmKey |
| FK_OutwardPackingSlipMain_ProductionDetailsId | OutwardPackingSlipMain.ProductionDetailsId |
| FK_QualityMasterDetail_QualityMasterMainId | QualityMasterDetail.QualityMasterMainId |
| FK_SizingRegisterDetail_FlangeId · FK_SizingRegisterMain_CompanyId | SizingRegisterDetail.FlangeId · SizingRegisterMain.CompanyId |
Plus a global column-name vocabulary recovered from catalog pages
(setNo, firmId, beamNo, billNo, netWt, millId, tagaNo,
loomNo, rollNo, baleNo, pieceNo, vehiNo, igstPer/igstAmt,
sgst*, cgst*, disPer/disAmt, accountYearId, changeDate,
empId, typeId, shiftId, loomTypeId, itemId, groupId,
cityId, tinNo, accNo, bankName, receiveAmount…) — matches the
FIELDMAP screenshot fields (Tally GST breakup, taga/roll/piece numbers).
What remains NOT recoverable without a restore: full per-table
column lists (names only, not types), row counts, clean row data — those
still need the §10.5 exports (or any 4K-page machine with SQL Server).