Skip to main content

Resetting contents

The demo import does not overwrite any existing contents. To import a demo again or to put an installation back into the state right after a fresh install, there are two ways.

Warning

Both commands delete contents. A database backup is created automatically beforehand – only turn it off if you are sure.

Deleting all contents (creuva:reset)

# Delete all contents (with confirmation and database backup)
vendor/bin/contao-console creuva:reset

# Delete contents and import the demo again
vendor/bin/contao-console creuva:install --demo --reset

In the back end, this corresponds to the option “Delete all contents first” under Layout › Creuva › Set up.

  • All Contao tables are emptied: site structure, articles, content elements, themes, modules, layouts, forms, news, versions, search index etc. The IDs start at 1 again.
  • Back end users and user groups, members and member groups and the file manager are kept.
  • Of the files, only the demo folder files/creuva-demo is deleted.
  • The backup is stored under var/backups/creuva-reset__<timestamp>.sql.gz; restore it with contao:backup:restore <file name>.
  • Without confirmation (e.g. in scripts): --force, without backup: --no-backup.

Replacing one website of a multisite installation (--replace)

--reset deletes all websites. If several websites run in one installation, --replace only replaces the website that the import would create:

vendor/bin/contao-console creuva:install --demo=files/meine-demo \
    --site-title="Meine Firma" --dns=example.org --theme-name="Meine Firma" --replace

This deletes the website roots with the same domain and language including their subpages and contents, the theme with the name from --theme-name and the themes whose layouts this website uses, as well as forms, news archives and calendars – but only if no other website uses them.

  • If the theme is also used by another website, the command aborts without deleting anything.
  • Before deleting, the command lists all affected records and asks for confirmation.
  • Files are kept; the import overwrites the demo files, their UUIDs stay the same.
  • If there is no matching website yet, --replace simply creates it.
  • Cannot be combined with --reset and --root; requires --demo or --with-pages.

Afterwards, rebuild the search index with contao:crawl.