Skip to the content
Documentation

Removing Exponential

No ratings yet

How to remove an Exponential 6 installation from a server, after exporting what it holds. Everything goes to disk in open formats (SQL, CSV, JSON, XML, plain files), so the site can be rebuilt elsewhere. Do the steps in this order and remove nothing before the export has been restored somewhere else.

Run the commands from the installation root, as the user the site runs as (as root, add --allow-root-user).

1. Freeze the content

php bin/php/maintenance.php on --message="This site is moving"
php bin/php/maintenance.php status

Visitors get a 503 page while you export, so nothing changes between the parts of the export.

2. Export

What How
Database, MySQL or MariaDB mysqldump --single-transaction --routines -u USER -p DATABASE > database.sql
Database, PostgreSQL pg_dump -U USER DATABASE > database.sql
Database, SQLite sqlite3 var/storage/sqlite3/exponential.db ".backup 'database.db'"
Files and images tar czf var-storage.tar.gz --exclude='var/cache' --exclude='var/*/cache' --exclude='var/tmp' var
Settings tar czf settings.tar.gz settings/override settings/siteaccess (it holds passwords: store it like a secret)
Your code tar czf code.tar.gz extension design composer.json composer.lock

exponential.db is the default file name of exp:install; use the name of your own file. Content can also be exported as CSV, JSON or XML, as packages, and through the REST API; every way is in Uninstalling Exponential 6.0. Restore the database dump on another machine and open a few pages before you go on.

3. Stop the cron job and the services

php bin/php/console exp:installcrontab --remove           # shows what would change
php bin/php/console exp:installcrontab --remove --apply   # removes the installer's block
crontab -l | grep -n "$(pwd)"                             # lines you added yourself
php bin/php/console exp:velocity stop
php bin/php/console exp:velocity status

Disable a boot service you made for Velocity (systemctl disable --now <unit>), and stop background workers you started for the job queue or other extensions.

4. Remove the virtual host

  • Velocity: php bin/php/console exp:velocity site disable --apply <name>, then remove its file from /etc/vc/sites-available/ (exp:velocity layout shows the files it uses).
  • Apache, nginx or a control panel: remove the virtual host or server block, the PHP-FPM pool of the site and the certificates made only for it; check the configuration (apachectl configtest, nginx -t) and reload.

5. Remove the database

Database Remove
MySQL or MariaDB DROP DATABASE DATABASE; DROP USER 'USER'@'localhost';
PostgreSQL dropdb -U postgres DATABASE and dropuser -U postgres USER
SQLite the file under var/storage/sqlite3/ goes with the files in step 6

Remove the database and the database user of the site, and nothing else. A search index of its own (Solr for ezfind) goes with its core.

6. Remove the files

Everything of the installation is below its root: the code, vendor/, extension/, settings/ and var/ (with an SQLite database). Remove the var storage first if VarDir points outside the root, then the root directory. Outside it remain only Velocity's configuration and state (/etc/vc/, /var/lib/vc/, /var/log/vc/, /var/cache/vc/), the virtual host, the PHP-FPM pool and the cron lines of the steps above, and your own backups.

To remove a single extension and keep the installation, see Extensions. The complete guide: Uninstalling Exponential 6.0.

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.