Resetting and rebuilding your study site
A study site is meant to be broken. This page shows you how to save it before a risky exercise, how to get it back, and how to start from a clean installation in a few minutes. All commands come from the installation pages and are run from the installation root.
Contents
- Three ways back
- Save before a risky exercise
- Restore a saved state
- Start over with a fresh install
- Keep your own work outside the installation
- What a reinstall removes
Three ways back
| You want to | Use | Time |
|---|---|---|
| Undo one content change | The item's versions or the trash (Publishing, versions and the trash) | Seconds |
| Return to a state you saved | A backup of the database and the files | Minutes |
| Start again from nothing | exp:install --force | A few minutes |
Try the smallest one first. Versions and the trash are part of the editor path, and using them is an exercise in itself.
Save before a risky exercise
A complete backup is the database and the files: var/storage (uploads and image variations),
settings/override and settings/siteaccess (Database support).
For the default SQLite database of exp:install (exponential.db under var/storage/sqlite3/), the database page
gives an online, consistent backup:
mkdir -p ../study-backups/2026-10-20
sqlite3 var/storage/sqlite3/exponential.db ".backup '../study-backups/2026-10-20/exponential.db'"
cp -a var/storage settings/override settings/siteaccess ../study-backups/2026-10-20/The first two lines follow Database support; the folder names are
examples. Keep the backups outside the installation, so a reinstall cannot remove them. If you installed with the
setup wizard, your SQLite file has the name you gave it (the default there is sqlite.db,
Installing Exponential 6.0).
On a study site for other databases, the same page lists the dump command of each.
Restore a saved state
From Database support:
- Switch on maintenance mode:
php bin/php/maintenance.php on --allow-root-user(leave out--allow-root-userwhen you are notroot). - Restore the database:
sqlite3 var/storage/sqlite3/exponential.db ".restore '../study-backups/2026-10-20/exponential.db'". Never copy a database file that is in use. - Copy back the folders you saved.
- Clear every cache:
php bin/php/ezcache.php --clear-all --allow-root-user, and with Velocity alsophp bin/php/console exp:velocity cache clear --apply --allow-root-user. - Switch maintenance mode off again (see Maintenance mode).
Start over with a fresh install
exp:install refuses to run over an existing installation unless you add --force
(Install in one command). Check first what it would do:
php bin/php/console exp:install --dry-run --random-password --url=http://localhost:8087
php bin/php/console exp:install --apply --force --random-password --url=http://localhost:8087--dry-run checks the configuration and the packages and installs nothing. Then the real run replaces the study
site and prints a new administrator password. Add --email= with an address at example.invalid, so the
administrator has no real mailbox; without it the installer uses its own default address.
For another database, --db-action=remove empties the named database first, so use a database that holds nothing
you need (Getting started).
Keep your own work outside the installation
Everything you want to keep across reinstalls belongs in Git, outside the folders a reinstall writes:
| Your work | Where to keep it |
|---|---|
| A design or a module you wrote | An extension of your own in extension/<name>, in its own Git repository (project 8) |
| Notes and the journal | A separate folder and repository (Keeping a study journal) |
| Content you want to install again | A package you export (Packages) |
| Changes to the kernel itself | A branch of your clone (Installing from Git clones for study) |
What a reinstall removes
When it finds an installation, exp:install says that it "would replace its database and settings" and asks for
--force (bin/php/install.php). So, after a forced reinstall:
- the content and users of the old database are gone;
- the settings the installer writes (in
settings/override/andsettings/siteaccess/) are written anew, so a setting you changed by hand is lost, and an extension of your own must be switched on again (Extensions).
Your Git branches and repositories are not part of the database or the settings. Treat anything else you need as something to back up first.
Related pages
- Installing a study site in one command
- Sharing one study site with a class
- Database support
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.