7x Exponential Network Docs Backups and rollback
← Command reference

Backups and rollback

xne command reference: Backups and rollback.

backup

xne backup [--root=DIR] [--dry-run]
  A verified backup now: the database plus the files the current plan would change.

A verified backup now: the database and the files the current plan would change. --dry-run lists what it would hold. The backup lives in <state_dir>/installs/<install>/backups/<id>/ and is read back before the command reports PASS.

backups

xne backups [--root=DIR]
  The backups of the install, newest first, with state and size.

Every backup of the install, newest first: id, state (verified, applying, applied, rolling-back, rolled-back, rollback-failed), from and to versions, method, file count, database engine, size.

verify-backup

xne verify-backup [BACKUP-ID]
  Reads a backup back: archive checksums, every file's md5, the dump to its end mark with its row counts.

Reads a backup back (default: the newest): the archive checksum, every file's md5, the dump to its end mark with its row counts; SQLite: the copy's integrity check and counts. Exit 1 when anything differs.

defaults

xne defaults [--root=DIR] --reference=DIR [--dry-run]
  An older install's settings brought to a fresh install's of the same kernel, the site's own kept: the
  reference's ActiveExtensions the install has but does not run (added after its own), admin4l and the access
  extensions on every administration siteaccess, AllowedDeletionDirs for a var/ link out of the install. A
  verified backup first (settings files + database), then the kernel's autoloads, its database stage (tables of
  the newly active extensions) and the cache clears; any failure rolls back (xne rollback works on it too).

--reference names the root of a fresh install made by the kernel's exp:install from the same release (a fresh install's extension list comes from its site package and the kernel's own defaults, so a real one is the only complete list). What changes, and only that:

  • settings/override/site.ini.append.php: ActiveExtensions[] keeps the site's list and order; the reference's extensions that the install has in extension/ and does not run are added after them. An extension the install does not have (the reference site's own) is never added.
  • every administration siteaccess (its SiteDesign is an admin design, or a design that exists nowhere followed by admin designs): SiteDesign=admin4l, the reference admin's AdditionalSiteDesignList[], and its ActiveAccessExtensions[] that the install has and does not run globally.
  • [FileSettings] AllowedDeletionDirs[]: the real folder of var/ when var/ is a link out of the install (a capture's arc/ tree); without it the kernel refuses every cache delete there.

Each file is edited line by line (comments, order and other settings stay). Before: a verified backup of those files and the database. After: the kernel's extension autoloads, its exp:upgrade database stage (the tables of the newly active extensions; the INI cache is cleared before it, and a database step still pending after it fails the run), the cache clears and the CLI bootstrap check; any failure rolls back. Settings already at the defaults with the kernel's database steps still pending (a run before 0.3.0.7) get the database stage on the next run; and xne rollback gives the settings back later. --dry-run shows the plan only.

rollback

xne rollback [BACKUP-ID] [--no-db] [--dry-run] [--shared=write]
  Files and database back to a backup (default: the newest). Files the upgrade added are moved aside into
  the backup, never deleted. Every path is checked first; a file in a folder that leads out of the install is
  restored only when the upgrade wrote it with --shared=write (recorded in the backup since xne 0.3.0.2), or
  with --shared=write here for an older backup.
xne rollback --git-tag=TAG [--dry-run]
  A git install's code back to a tag (git reset --keep); the database is not touched.

Without an id, the newest backup. Files the upgrade added are moved aside into the backup, archived files are written back (checked against their md5), library folders lose what was added since, a git install is reset to the commit it was on (git reset with --keep, which refuses to overwrite local changes), the database is restored (counts checked, tables made since are dropped), then autoloads and caches. --no-db leaves the database. --git-tag moves a git install's code to a tag and leaves the database alone. Every path of the archive is checked before anything changes, so a refusal leaves the install as it was. Files an upgrade wrote through a link out of the install (--shared=write) go back through the same link: the backup records them since 0.3.0.2; for an older backup say --shared=write again. Details: rollback-guide.md.


← Planning and upgrading · Checks, reports and install keys →