Skip to main content

Migration Overview

Purpose

The migration tool imports legacy data from the DETI Maker Lab MediaWiki installation into the new system. It allows the lab to preserve historical records (users, projects, equipment) without losing the accumulated data from years of operation.


What gets migrated

EntitySourceDestination
Usersauth_user table in the wiki PostgreSQL dumpusers table in MakerLab PostgreSQL
ProjectsWiki article revisions of type projectprojects table in MakerLab PostgreSQL
Project membersProject XML ownership/membership dataproject_members table
Equipment modelsWiki article revisions of type equipmentequipment_models in PostgreSQL + Snipe-IT models
Equipment assetsEquipment wiki revisions (individual units)equipment in PostgreSQL + Snipe-IT assets

What is NOT migrated (in the initial phase):

  • Equipment requisition history from the wiki.
  • Wiki revision history (only the latest revision per article is used).
  • Full-text wiki page content.

Where migrated data goes

DestinationWhat goes there
PostgreSQLUsers, projects, project members, equipment models, equipment records
Snipe-ITEquipment models (as Snipe-IT models), equipment assets (as Snipe-IT assets), users

Equipment models and assets are created in both systems. PostgreSQL stores the local snipeit_model_id and snipeit_asset_id references to link the two.


Migration tool location

apps/migration/makerlab_migrate/
├── cli.py # Entry point
├── settings.py # Configuration loader
├── dump/ # Legacy dump reader and wiki content parser
├── postgres/ # PostgreSQL upsert logic
├── snipeit/ # Snipe-IT API client for migration
└── orchestration/ # Migration coordinator

Key properties

  • Idempotent: Safe to run multiple times. Uses upsert logic — no duplicates are created.
  • Incremental: Supports incremental re-runs via checkpoint tracking.
  • Dry-run mode: Preview all operations without writing any data.
  • Phase-based: Runs in phases — users → projects → equipment — to respect foreign key dependencies.

When to run migration

Migration is optional but recommended when:

  • The new system is being deployed for the first time.
  • You want to preserve historical project and user records from the old wiki.
  • The lab has legacy equipment records you want visible in the catalog immediately.

Migration is not required for the system to function — it can be started fresh with no data.


Prerequisites

Before running migration:

  1. The Docker stack must be running (PostgreSQL and Snipe-IT must be accessible).
  2. Snipe-IT must be bootstrapped (API token generated).
  3. Snipe-IT status labels must be configured.
  4. You must have the legacy wiki PostgreSQL dump file (e.g., dump-1776931288).
  5. The migration environment file (apps/migration/.env) must be configured.