{"_id":"55bf8ff483675d17000b9b2f","user":"5589b346986b6c0d00f54355","version":{"_id":"55bf8ff383675d17000b9b2a","__v":1,"project":"5589b4b0db0a020d00a75f8a","createdAt":"2015-08-03T15:59:47.166Z","releaseDate":"2015-08-03T15:59:47.166Z","categories":["55bf8ff483675d17000b9b2b"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"0.18.0","version":"0.18"},"__v":1,"project":"5589b4b0db0a020d00a75f8a","category":{"_id":"55bf8ff483675d17000b9b2b","pages":["55bf8ff483675d17000b9b2c","55bf8ff483675d17000b9b2d","55bf8ff483675d17000b9b2e","55bf8ff483675d17000b9b2f","55bf8ff483675d17000b9b30","55bf8ff483675d17000b9b31"],"version":"55bf8ff383675d17000b9b2a","__v":1,"project":"5589b4b0db0a020d00a75f8a","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-06-23T19:34:09.101Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-05T05:23:29.476Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"Note: This documentation assumes you've done an initial deployment to `/tmp` per the Deployment docs. I would suggest starting there just to make sure you understand the prerequisites.\n\nSo you've made some changes to your app, and you want to generate a new release and perform a hot upgrade. I'm here to tell you that this is going to be a breeze, so I hope you're ready (I'm using my test app as an example here again):\n\n1. `mix release`\n2. `mkdir -p /tmp/test/releases/0.0.2`\n3. `cp rel/test/releases/0.0.2/test.tar.gz /tmp/test/releases/0.0.2/`\n4. `cd /tmp/test`\n5. `bin/test upgrade \"0.0.2\"`\n\nAnnnnd we're done. Your app was upgraded in place with no downtime, and is now running your modified code. You can use `bin/test remote_console` to connect and test to be sure your changes worked as expected.\n\nYou can also provide your own .appup file, by writing one and placing it in\n`rel/<app>.appup`. This location is checked before generating a new\nrelease, and will be used instead of autogenerating an appup file for\nyou. If you don't know what an appup file is, it is effectively the file which describes how the upgrade will be performed. To learn more about what goes in this file and how appups work, please consult the Erlang documentation for appups, which is located [here](http://www.erlang.org/doc/design_principles/appup_cookbook.html).\n\n## Downgrading Releases\n\nThis is even easier! Using the example from before:\n\n1. `cd /tmp/test`\n2. `bin/test downgrade \"0.0.1\"`\n\nAll done!","excerpt":"How to perform hot upgrades and downgrades!","slug":"upgradesdowngrades","type":"basic","title":"Upgrades/Downgrades"}

Upgrades/Downgrades

How to perform hot upgrades and downgrades!

Note: This documentation assumes you've done an initial deployment to `/tmp` per the Deployment docs. I would suggest starting there just to make sure you understand the prerequisites. So you've made some changes to your app, and you want to generate a new release and perform a hot upgrade. I'm here to tell you that this is going to be a breeze, so I hope you're ready (I'm using my test app as an example here again): 1. `mix release` 2. `mkdir -p /tmp/test/releases/0.0.2` 3. `cp rel/test/releases/0.0.2/test.tar.gz /tmp/test/releases/0.0.2/` 4. `cd /tmp/test` 5. `bin/test upgrade "0.0.2"` Annnnd we're done. Your app was upgraded in place with no downtime, and is now running your modified code. You can use `bin/test remote_console` to connect and test to be sure your changes worked as expected. You can also provide your own .appup file, by writing one and placing it in `rel/<app>.appup`. This location is checked before generating a new release, and will be used instead of autogenerating an appup file for you. If you don't know what an appup file is, it is effectively the file which describes how the upgrade will be performed. To learn more about what goes in this file and how appups work, please consult the Erlang documentation for appups, which is located [here](http://www.erlang.org/doc/design_principles/appup_cookbook.html). ## Downgrading Releases This is even easier! Using the example from before: 1. `cd /tmp/test` 2. `bin/test downgrade "0.0.1"` All done!