Skip to main content
onebooksgst Logo

Migrating from Marg ERP: Protecting Batch and Expiry Data

Moving off Marg means moving live batch positions, not just balances. Export sequence for distribution businesses, scheme and margin structures, and batch-specific verification checks.

7 min read
Topics:MigrationMarg ERPPharmaBatch ExpiryInventoryDistribution
Marg ERP batch and expiry stock migrating into OneBooks GST
What you'll learn from this guide
  • Migration
  • Marg ERP
  • Pharma
  • Batch Expiry
  • Inventory

Marg ERP is entrenched in pharmaceutical distribution, FMCG and retail chemist businesses, largely because of its batch and expiry handling. Any move away from it has to protect that capability first.

Batch and expiry data is the hard part

Ordinary accounting migration moves balances. A Marg migration also has to move live batch positions, because each batch carries its own quantity, expiry date and purchase rate.

Batch-level stock should be exported as one row per item-batch, never summarised to item level. OneBooks GST inventory treats batch as part of the stock identity.

Migration sequence for a distribution business

  1. Freeze new entries in Marg for the cut-off day.
  2. Export item master with HSN, pack size, unit and tax rate.
  3. Export batch-wise closing stock: item, batch, expiry, quantity, rate.
  4. Export party masters including drug licence numbers where held.
  5. Export outstanding receivables and payables.
  6. Import into the new system and reconcile stock value before resuming entry.

Do not lose the scheme and margin structure

Distribution pricing carries trade discount, scheme quantity and margin percentages that rarely survive a plain master export. Document the current scheme structure separately and rebuild it deliberately rather than assuming it migrated.

Verification specific to batch businesses

Batch count per item matchesA missing batch means unsellable stockExpiry dates carried correctlyDrives near-expiry returns and write-offBatch-wise value totals to stock valueConfirms valuation is intactDrug licence numbers on partiesRequired on pharma invoices

Preparing the warehouse before the cut-off

A batch migration is only as good as the physical stock position it starts from. Migrating a batch list that does not match the shelves just moves an existing problem into a new system.

  1. Run a physical count by item and batch, not by item alone.
  2. Reconcile counted batches against Marg's batch-wise stock report.
  3. Investigate batches showing stock that cannot be found.
  4. Write off expired stock before the migration rather than after.
  5. Freeze movement once the reconciled position is agreed.

Pricing structures need documenting separately

Distribution pricing is layered, and a plain master export flattens it. Record the current structure before the move so it can be rebuilt deliberately.

Base purchase rateItem masterYesTrade discount percentageParty or scheme masterRarelyScheme quantity, free goodsScheme masterNoRetailer marginPrice listSometimesParty-specific ratesParty price listRarely

Statutory records specific to pharma

Pharmaceutical distribution carries record-keeping obligations beyond GST, and these do not pause for a software change.

Keep the Marg installation readable until you are confident the new system reproduces every record an inspection could request.

Sequencing the first month after the move

  1. Week one: purchases only, confirming batch inward works as expected.
  2. Week two: add sales, checking expiry-first picking behaves correctly.
  3. Week three: run returns and credit notes, which are where batch logic is most often wrong.
  4. Week four: close the month and reconcile batch-wise stock value.

Mapping units and pack sizes

Distribution items carry nested units: a case contains boxes, a box contains strips. Getting this wrong at import produces stock figures that are out by an order of magnitude.

  1. List every unit in use and its relationship to the base unit.
  2. Decide the base unit for each item and keep it consistent.
  3. Convert opening stock into the base unit before import.
  4. Check a sample of items by recomputing the value from quantity and rate.
  5. Confirm purchase and sale defaults use the intended unit.

Credit notes and expiry returns

Return flows are where batch logic is tested hardest, and they are rarely covered in a migration plan until something goes wrong.

Verifying the first month-end after the move

Batch-wise stock valuePhysical count at month endTotal stock valueTrial balance inventory figurePurchase totalSupplier statementsSales totalGSTR-1 summaryExpired stock provisionNear-expiry report

Running all five in the first month is the only reliable way to know the migration held. Discovering a batch valuation error in month four means four months of restatement.

Costing the move honestly

A Marg migration costs more than a general accounting move, and budgeting for it properly avoids abandoning the project halfway.

Physical count by item and batchOne to three days, business size dependentMaster cleanup and unit mappingTwo to four daysBatch position export and importOne to two daysRebuilding scheme and pricing structuresTwo to five daysParallel running and verificationOne month, part time

The scheme rebuild is the item most often underestimated, because it rarely exists as a single exportable table and usually lives partly in someone's head.

Deciding what history to carry

Distribution businesses accumulate large transaction volumes, and the instinct is to bring everything. Most of it is better archived.

  1. Carry current batch positions, since operations depend on them.
  2. Carry open receivables and payables.
  3. Carry item, party and licence master data.
  4. Archive closed transactions as exported reports.
  5. Keep the Marg installation readable for recall and inspection queries.

Signs the migration is complete

Frequently asked questions

Is a mid-year move from Marg advisable?

Less so than for a general trading business, because batch positions move daily. A financial year boundary, or a genuine stock-take date, gives a far cleaner cut-off.

What about pending purchase and sales orders?

Open orders are usually re-entered manually. There are rarely enough of them at a cut-off to justify building an import, and re-entry doubles as a review.

Can both systems run in parallel?

For one month, yes, and it is worth it. Run a full purchase-to-sale cycle in the new system while Marg remains available for comparison.

OneBooks GST publishes practical guides to help Indian businesses understand compliance, reconciliation, and reporting workflows.

Keep reading

More Tally Integration guides

Turn this workflow into a 5-minute process.

Use OneBooks GST to upload files, validate data, reconcile mismatches, and keep monthly GST work moving.