Sari la conținutul principal
FreeThree checks for your projectUptime, accessibility, SEO and cookie checks for your project
Menu

Roll back

Return an environment to an earlier release, and know what a rollback changes and what it leaves alone.

On this page

A rollback returns an environment to a release it ran before. Tilizy keeps earlier releases on the server, so going back to the previous one is a switch, not a new build. Use it when a release misbehaves and you want the last good version serving while you fix the cause.

Roll back to the previous release

  1. See which releases you can go back to. The list shows a deployment number for each release, with its tag or commit:

    tilizy app:rollback --list
  2. Roll back. Without a selector, the command goes to the release just before the current one:

    tilizy app:rollback

    The command asks you to confirm, then shows the progress until the job ends.

  3. Open the website and check it.

The command acts on the live environment unless you say otherwise. Add --staging or -e <branch> for another environment. In the portal, a rollback to the previous release is one click.

Roll back to a chosen release

To a release tag:

tilizy app:rollback --to v1.4.2

To an exact deployment, by the number from --list:

tilizy app:rollback --deployment 128

Use one selector or the other, not both.

Options

OptionWhat it does
--listLists the releases you can roll back to and changes nothing.
--to <tag>Rolls back to this release tag.
--deployment <number>Rolls back to this exact deployment of the environment.
--dbAlso restores the database snapshot taken before the deploy you are undoing.
-y, --yesSkips the confirmation.
--no-followQueues the rollback and returns at once.

What a rollback changes

  • Code: yes. The environment serves the earlier release. When that release is still on the server, the switch is immediate. When it has been cleaned up, Tilizy rebuilds it from its tag first.
  • Database: no, unless you ask. By default the database stays as it is. With --db, Tilizy also restores the snapshot taken just before the deploy, if that snapshot exists.
  • Uploaded files: no. The files in your persistent folders stay as they are.
  • Your repository: no. Nothing in Git changes. The next deploy ships whatever the branch or the tag holds.
Warning: --db replaces the database with its state from before the deploy. Everything written since then is lost: orders, form entries, new content. Use it only when the database changes of the release are the problem.

What can go wrong

  • The old code meets a newer database. A code-only rollback leaves the database changes of the release in place. If the previous release cannot work with them, it fails after the rollback as well. Write database changes so that the previous release keeps working: add first, remove in a later release.
  • The release is gone on an environment that follows a branch. The rollback needs the exact commit of the earlier release. If it is no longer available, the rollback fails. It never deploys the newest commit of the branch in its place.
  • The broken release comes back. A rollback does not undo your commit. On an environment that follows a branch, the next push deploys the branch again, including the faulty change. Revert or fix the change in Git.
  • A long-running process does not come back. Declared processes are restarted on a rollback. If one does not start, read the logs with tilizy app:logs --prod.

Next: Backups and restore and Deploy from the terminal.