canasta import

From Canasta Wiki

canasta > import

canasta import

Import a database into an existing wiki

Synopsis

Import a database dump into an existing wiki, replacing its current database. The instance must be running. A dump may be plain SQL or compressed with gzip, xz or zstd; its contents, not its name, decide which. For a wiki on an external database, a compressed dump must be gzip, the only format the web container can decompress.

The extra databases the wiki declares (see canasta backup databases) are imported too, each from the dump canasta export writes beside the main one: <stem>.<database>.sql, .sql.gz, .sql.xz or .sql.zst, where <stem> is the main dump's path without its .sql extension and compression suffix. An extra database with no such dump is left as it is, and reported.

After the import, update.php runs for the wiki so an older dump's schema matches the installed MediaWiki and extensions. Pass --skip-update to leave the schema as the dump has it.

To create a new wiki from a database dump, use the --database flag with canasta create or canasta add instead.

canasta import [flags]

Examples

canasta import -w main -d dump.sql
canasta import -w main -d dump.sql.xz

Flags

Flag Shorthand Description Default Required Orchestrator
--database -d Path on the controller (the machine running canasta) to a SQL dump file (plain, or compressed with gzip, xz or zstd) ✓ Both
--wiki -w ID of the wiki to import into ✓ Both
--id -i Canasta instance ID * Both
--skip-update Skip running update.php after importing Both
--wiki-settings -l Path on the controller (the machine running canasta) to a per-wiki Settings.php to replace the current one Both

* Defaults to the Canasta instance matching the current directory, if any.

Global flags

Flag Shorthand Description Default Required Orchestrator
--help -h Show help message and exit Both
--verbose -v Enable verbose output Both