Help:Wiki lifecycle

From Canasta Wiki

This page covers the full lifecycle of a Canasta installation: creating wiki farms, adding and removing wikis, importing existing databases, running maintenance scripts, and deleting installations.

Creating an installation

Use canasta create to create a new Canasta installation. At minimum, you need an instance ID, a wiki ID, and a server name:

canasta create -i myinstance -w main -n example.com

This creates a single-wiki installation. The installer runs automatically, generating an admin account (default: WikiSysop) and printing the password.

To create a wiki farm from the start, add more wikis after creation with canasta add (see below).

Common flags

Flag Description
-i Instance ID (used to identify the installation)
-w Wiki ID for the first wiki
-n Server name (domain)
-a Admin username (default: WikiSysop)
-d Database dump to import instead of running the installer
-o Orchestrator: compose (default) or kubernetes

See the CLI reference for the full list of flags.

Importing an existing wiki while creating an installation

To migrate an existing MediaWiki installation into Canasta, prepare a database dump (.sql or .sql.gz file) and pass it with the -d flag:

canasta create -i myinstance -w main -n example.com -d ./backup.sql.gz

You can also provide a per-wiki settings file and an environment file with password overrides:

canasta create -i myinstance -w main -n example.com -d ./backup.sql.gz -l ./my-settings.php -e ./custom.env

The -l flag (--wiki-settings) copies the specified file to config/settings/wikis/{wiki-id}/, preserving the filename. Use it to bring over custom settings from an existing wiki.

See the CLI Reference for the full list of flags.

Adding a wiki

Use canasta add to add a wiki to an existing installation, turning it into a wiki farm (or adding to an existing farm). Each wiki needs a wiki ID and a URL:

canasta add -w docs -u example.com/docs

This registers the new wiki in wikis.yaml, regenerates the Caddyfile, and runs the MediaWiki installer for the new wiki.

Path-based vs. subdomain-based wikis

Wikis can be accessed by path or by subdomain:

# Path-based: same domain, different path
canasta add -w docs -u example.com/docs

# Subdomain-based: different domain
canasta add -w blog -u blog.example.com

See Wiki farms for more on farm architectures.

Importing an existing wiki while adding

To add a wiki with an existing database dump instead of running the installer:

canasta add -w docs -u example.com/docs -d ./docs-backup.sql.gz

See the CLI reference for the full list of flags.

Removing a wiki

Use canasta remove to remove a wiki from an installation. This deletes the wiki's database, settings files, uploaded images, and its entry in wikis.yaml:

canasta remove -w docs

You will be prompted for confirmation before any data is deleted. Use -y to skip the prompt:

canasta remove -w docs -y

Template:Warning

See the CLI reference for the full list of flags.

Deleting an installation

Use canasta delete to permanently delete an entire installation. This stops and removes all containers and volumes, deletes all configuration files and data, and removes the installation from the Canasta registry:

canasta delete

You will be prompted for confirmation. Use -y to skip the prompt:

canasta delete -y

Template:Warning

See the CLI reference for the full list of flags.

Maintenance scripts

MediaWiki includes over 200 maintenance scripts for tasks like changing passwords, importing images, and managing the database.

Automatic maintenance

You generally do not need to run maintenance scripts manually:

  • update.php runs automatically during container startup. If you need to run it, simply restart the installation with canasta restart.
  • runJobs.php runs automatically in the background for the entire life of the container.

Running the update sequence

Use canasta maintenance update to run the standard update sequence: update.php, runJobs.php, and (if Semantic MediaWiki is installed) rebuildData.php. Each script runs separately with its output streamed in real time.

canasta maintenance update

In a wiki farm, use -w to target a specific wiki. Without -w, the command runs on every wiki:

canasta maintenance update -w docs

If the installation has only one wiki, it is selected automatically.

Use --skip-jobs and --skip-smw to skip individual steps:

# Run only update.php
canasta maintenance update --skip-jobs --skip-smw

Running scripts manually

To run an arbitrary MediaWiki core maintenance script, use canasta maintenance script. Wrap the script name and any arguments in quotes so they are passed as a single argument:

canasta maintenance script "createAndPromote.php WikiSysop MyPassword --bureaucrat --sysop"

To list all available core maintenance scripts:

canasta maintenance script

Use -w to target a specific wiki in a farm:

canasta maintenance script "rebuildrecentchanges.php" -w docs

Running extension maintenance scripts

Many extensions include their own maintenance scripts (e.g., Semantic MediaWiki, CirrusSearch, Cargo). Use canasta maintenance extension to discover and run them.

List all loaded extensions that have maintenance scripts:

canasta maintenance extension

List available scripts for a specific extension:

canasta maintenance extension SemanticMediaWiki

Run an extension maintenance script. Flags (-i, -w) come before the extension name; everything after is the script and its arguments — no quotes needed:

canasta maintenance extension SemanticMediaWiki rebuildData.php
canasta maintenance extension CirrusSearch UpdateSearchIndexConfig.php --reindexAndRemoveOk --indexIdentifier now

For large operations, pass script-specific options directly:

canasta maintenance extension SemanticMediaWiki rebuildData.php -s 1000 -e 2000

Use -w for wiki farms, just like other maintenance commands. Without -w, the command runs on all wikis:

canasta maintenance extension -w docs SemanticMediaWiki rebuildData.php

Only extensions that are currently loaded (enabled) for the target wiki are shown and can be run.

See the CLI Reference for more details.