10 · Migration from legacy software

◀ Back to contents

Factuzam includes a separate Factuzam Migrator tool (FactuzamMigrator.exe) that transfers data from the previous ERP (SQL Server database) to the factuzam database (MariaDB). This chapter explains what it migrates, how to prepare the destination database, and how to run and verify the migration.

This is an administrator operation that is normally performed once during go-live. It requires access to both databases (old and new).


1. What it is and what it needs

Migrator main screen


2. Data migrated

The migrator transfers the following domains in dependency order:

Domain Data migrated
Formas de pago, Grupos de IVA, IVAsBase catalogues.
EmpresasIssuing companies.
AlmacenesWarehouses (and their tills, series and counters).
ClientesComplete customer records.
ProveedoresComplete supplier records.
FamiliasItem sections and families (with their hierarchy).
Colores y tallasMaster attribute catalogues.
ArtículosItem catalogue.
Colours/sizes by item, tallajesVariation assignments by item.
SKUsSaleable variants plus barcodes.
InventariosStocktakes and their lines.
MovimientosWarehouse movements (and reconstruction of current stock).
Ventas (caja)Till operations, payments and customer deposits.
FacturasInvoices and their lines.
ComprasPurchase orders, delivery notes, supplier returns and purchase invoices.
Cartera de pagosPurchase payables and supplier payment remittances.
EmpleadosTill operators, transfers and cash counts, separate from login users.

Migration runs in parallel waves: mutually independent domains are processed at the same time, and each wave waits for the previous one to finish (catalogues → master data → variants → documents).


3. Preparing the destination database

Migrator has a «Preparar BBDD destino» section with three buttons for creating the new database without depending on external files:

  1. Extraer esqueleto de BBDD viva… — connects to a reference factuzam database and generates an .sql containing the complete structure (tables, views and procedures) and data from system tables (countries, VAT types, windows, metadata and so on). Business tables (items, customers, invoices and so on) are empty because migration will populate them.
  2. Crear BBDD destino — creates the database specified in the Destination panel with the utf8mb4 character set and utf8mb4_spanish_ci collation.
  3. Cargar esqueleto en destino… — loads the .sql from step 1 into the newly created database.

Preparar BBDD destino section

Alternatively, create the destination database from factuzam_original.sql as described under installation. In that case, also apply any schema scripts required by the migrator if your dump predates them (extensions to customer codes, supplier name, family hierarchy, stocktake lines, employees, purchases, purchase invoices and payment portfolio).


4. Running the migration step by step

  1. Back up both databases (source and destination).
  2. Open FactuzamMigrator.exe.
  3. Configure the Origen panel (SQL Server): host, port, database, user and password. Press Probar conexión.
  4. Configure the Destino panel (MariaDB) in the same way and test the connection.
  5. Select the migrations to run. The list already respects dependency order; select all of them for a complete migration. For purchasing, the domains follow master data and SKUs: orders, delivery notes, supplier returns, purchase invoices, payables and payment remittances.
  6. Press Ejecutar migraciones. During processing:
    • The progress panel shows one line per active domain, with its live X / Y (Z %) counter.
    • The button changes to Cancelar: pressing it completes the current domain and then stops (anything already migrated remains complete).
  7. When it finishes, review the summary and error panel.

Migration in progress

Safe re-execution (idempotency)

Migrations are idempotent: if a record already exists at the destination, it is skipped (counted as “skipped”) and processing continues. Each domain runs within a transaction: if something fails, that complete domain is rolled back (the others continue). After an isolated failure, you can therefore correct the cause and run it again without duplicating data.

Error log

Each run records information in three places:


5. Manual adjustments after migration

The first version of the migrator applies some heuristics that should be reviewed manually once migration has finished:

Data What the migrator does What to review afterwards
Tipos de IVAThe legacy system stores history by date; the highest percentage is taken as standard VAT and reduced/super-reduced/exempt are left at 0.Complete the reduced, super-reduced and exempt percentages under Otros ▸ Impuesto IVA.
Código de almacénThe legacy system indexes by (company, warehouse); the destination requires a globally unique code. It generates E<empresa>-A<almacén>.Rename codes if another convention is preferred.
Tipo de IVA por artículoThe legacy system stores an integer; everything is migrated as Normal VAT (N).Mark items with reduced/super-reduced/exempt VAT.
Forma de pago del clienteThe legacy efecto code is used as the payment-method code.Verify that migrated payment methods have the required description and behaviour.
FamiliasLegacy sections and families are sent to the same table, retaining the section → family hierarchy.Review the resulting family tree.
Conjuntos de tallas por artículoThe catalogues and colour/size assignments are migrated, but the specific size set for each item is not.Assign the attribute collection to items that need it (Archivo ▸ Tablas Auxiliares ▸ Colecciones de Atributos).
Compras históricasOrders, delivery notes, returns and invoices are reconstructed with one line per SKU and its pivoted sizing.Open samples under Compras and review supplier, warehouse, status, totals and taxes.
Efectos de compraLegacy due dates are imported and reconciled when already recorded as paid.Review pending and paid efectos and remittances before starting operations.

6. Final verification

Before accepting the migration:

  1. Reconcile totals: compare the number of customers, suppliers, items, SKUs and invoices in the source and destination (the migrator summary shows inserted/skipped/error counts by domain).
  2. Stock: compare stock for a sample of items with the old system (Almacén ▸ Informes). The migrator reconstructs stock from movements.
  3. Documents: open several migrated invoices, till operations and purchases and check amounts and taxes.
  4. Test sales: make a test receipt in the POS and a test invoice in Ventas Mayor.
  5. Portfolio: review purchase payables and remittances to check due dates, statuses and banks.
  6. Apply the manual adjustments from the previous section.
  7. Make a backup of the migrated database: this is your official starting point.

Until verification is complete, retain the old software and database in read-only mode as a historical reference.


◀ Installation on Windows · Contents · Next ▶ Verifactu (AEAT)