Jump to content

ICT:MediaWiki CleanUp Procedure

From Costa Sano MediaWiki

MediaWiki Cleanup & Fresh Start Procedure (Cargo + Page Forms)

Purpose

This page describes the safe procedure to remove experimental / test work before rebuilding the Costasano Heritage system using:

  • Cargo (data storage)
  • Page Forms (data entry)
  • Templates (schema definition)

We intentionally avoid Page Schemas because it does not support:

  • enforced namespaces
  • automatic page naming
  • strict workflow control

A clean reset prevents schema conflicts, duplicate forms, and long-term maintenance issues.


Guiding principles

  • Keep the system predictable and explicit
  • One template = one Cargo table
  • One form = one data entry workflow
  • No legacy or experimental artifacts in production namespaces
  • Delete test content aggressively

If something is not part of the real system → remove it.


Step 0 – Backup (mandatory)

Before deleting anything:

Either:

  • Database dump (mysqldump), or
  • Special:Export XML backup

Never skip this step.


Step 1 – Remove Page Schemas artifacts

We no longer use Page Schemas.

Delete:

  • Schema:* pages
  • Forms generated by Page Schemas
  • Templates generated by Page Schemas
  • Any helper categories or leftover scaffolding

If unsure, temporarily rename with "_old" first.

Example:

Template:DigitalAsset → Template:DigitalAsset_old

Step 2 – Delete test content pages

Remove all experimental pages:

  • DigitalAssets test pages
  • HeritageObjects test pages
  • dummy entities
  • sandbox objects

Goal:

System starts with ZERO content.

This avoids mixing test data with production data later.


Step 3 – Delete test Forms and Templates

Delete any temporary or experimental items:

  • Form:Test*
  • Template:Test*
  • old prototype templates
  • duplicate versions (v2, final, new, etc.)

Keep names clean and canonical.

Avoid:

Template:DigitalAsset2
Template:DigitalAsset_final
Template:DigitalAsset_new

Only keep:

Template:DigitalAsset

Step 4 – Clean Cargo tables

Cargo tables persist even if templates are deleted.

Go to:

Special:CargoTables

Then:

  • delete test tables, or
  • recreate them later from clean templates

This step is critical to avoid schema mismatches.


Step 5 – Delete test uploaded files

Go to:

Special:ListFiles

Delete:

  • dummy images
  • sample PDFs
  • temporary uploads

Reasons:

  • reduces clutter
  • faster backups
  • prevents test assets appearing in production

Step 6 – (Optional) Disable Page Schemas extension

If no longer needed, disable it in LocalSettings.php:

wfLoadExtension( 'PageSchemas' );

Comment out or remove.

This prevents accidental reuse.


Rebuild order (recommended workflow)

After cleanup, rebuild in small steps.

1. Create templates

Each table gets exactly one template using:

#cargo_store

2. Create Cargo tables

Special:CargoTables → Recreate data

3. Create Page Forms

  • set target namespace
  • set page name formula
  • hide title

4. Test one full workflow

Create → save → query

Only then add more tables/forms.

Do not build everything at once.


Architectural rules

Rule 1 – One table, one template

Each DBML table maps to exactly one template.

Rule 2 – Use namespaces strictly

Example:

  • DA: for DigitalAssets
  • HO: for HeritageObjects

Forms must enforce namespaces automatically.

Rule 3 – Prefer Page fields over raw IDs

Use:

input type=page

instead of plain text.

Benefits:

  • autocomplete
  • fewer errors
  • clickable links

Rule 4 – Use junction tables for many-to-many

Never embed lists manually. Always create explicit Cargo junction tables.


Final note

Prototype → learn → delete → rebuild clean.

A fresh start is faster and safer than trying to fix experimental scaffolding.

Clarity beats cleverness. Explicit beats automatic magic.