Skip to content
ErawanACADEMYไทย

Keep it running

The new version has a problem. Go back to the old one in seconds.

You just put a new version online, and the page is blank, a button does nothing, or a customer says they cannot get in. Before you dig for the cause, go back to the version that worked, then fix it.

Stuck somewhere? Erawan looks into it for free on Hobby and above.

Tell your AI to go back

Tell the AI you connected to Erawan, and the app goes back to the previous version within seconds. The link stays the same, so there is nothing to send anyone again.

Roll my-app back to the previous version.

If you run it yourself in a terminal, the command is:

erawan rollback my-app

Why it is fast

Erawan keeps two built versions of each app: the one running and the one before it. Going back needs no rebuild. It switches to the one already kept. So if the new version has a problem, go back first. You do not have to find the cause before you do.

One step back, not more

Because two are kept, this command only reaches the previous version. An older one is still within reach, because the code of every version is kept: have your AI pull that version's code and deploy it again. Version numbers are in erawan status my-app.

erawan pull my-app --version 3

A website made only of files, with no program running behind it, cannot use rollback. Erawan tells you to deploy the previous code again instead, which works the same way as above.

If the app broke on its very first deploy, there is nothing behind it, and you get No previous version to roll back to. The only way out is to fix it and deploy again.

Your data does not go back

This command changes only the code your app runs. The database and the files on the disk stay exactly as they are. That is usually what you want, but watch for two cases.

  • The new version already wrote bad data. Going back to the old code leaves that data where it is. That needs a different repair, covered in rewinding your database.
  • The new version changed the tables. If it added a column or ran a migration, the old code may not start against the new tables. If the app is still broken after going back, tell your AI that the version you left had changed the database.

Go back, then fix it

Going back keeps the app usable while the fix is not ready, but the problem is still in the code. Once your AI has fixed it, deploy again under the same app name. The app moves on to the next version on the same link, and the version you went back from stays in the history if you want to look at it.

All Erawan Cloud lessons

Roll back to the previous version — Erawan