With Odoo.sh, you can't rename the production branch, but you can change which branch is in production.
Plan and Test Carefully
- PRODUCTION WILL BE DOWN during this process
- YOUR CUSTOM DOMAIN will not work during this process
The production database is deleted during this process
- MAKE SURE YOU HAVE A BACKUP TO RESTORE FROM
If the production build fails, the “Backups” menu disappears,
- don’t freak out, your backups are still there
- after a successful production build and after you exit and re-enter the project, the “Backups” menu will show up again
Your custom domain stays with the branch,
- The custom domain must be removed from the old production branch and added to the new production branch as part of this process
- The SSL/TLS certificate needs to be regenerated after you add the custom domain to the new production branch, this takes time
This change may result in a new server IP address, which can cause a brief disruption if DNS caches haven't yet expired.
- If DNS caching (TTL) has cached the old IP, users might hit the wrong server for a short window after Odoo changed the production IP. This resolves itself automatically once the cache expires.
- Flushing your local computer’s DNS cache can help you to see the changes faster
- Schedule this work during your lowest-traffic window.
Before you start: determine which option applies to you:
OPTION 1:
Verify that your custom modules install cleanly against an empty Odoo database. If they do, create your new production branch as a duplicate of your production source code.
You must test this by creating a new development branch without applying the Odoo demo data and applying your custom modules, and make sure the build is green or yellow (not red)
OPTION 2:
- If Option 1 fails, start your new production branch without custom source code — or modify it — so that it builds successfully against an empty database. Restore the production backup first, then apply your final custom modules on top.
You must test this using a combination of an empty development database and staging database to make sure you have a procedure that works
You need three verified states:
the repo builds against an empty database.
that same repo works after the production backup is restored.
that you can safely apply the missing source code after the production database has been restored
OPTION 3:
- If you can't get option 1 or 2 to work safely, DO NOT EXECUTE THIS PROCEDURE
Procedure
- Screenshot the production branch settings and save them somewhere accessible. (You'll need these to recreate settings on the new branch.)
- Note any branch settings that may need to be adjusted as part of this process
Add to odoo.sh development the new branch that will become production
- Create this new development branch based on the production branch so the source code matches exactly (if using OPTION 1 above, if using OPTION 2 you may need to do something different to prepare this branch)
- As noted above, this branch must work against both an empty Odoo database (for when the production database gets created fresh, and then after the production database has been restored)
- Turn off the global project setting "Block access to the .odoo.com domain" — if this is left on, the production build will fail.
- Back up any staging environments you want to keep
- Backup production
Drag all odoo.sh staging branches to odoo.sh development (do not merge into an existing development branch)
- Staging branches cannot exist without a production branch, so they must be moved before you remove production.
Drag the odoo.sh production branch to odoo.sh development (do not merge into an existing development branch)
- When you do this, you will get a warning that your production database will be deleted, it sounds scary and it is, but that is why you made a backup earlier in the procedure
Drag what will become the new production branch from odoo.sh development to odoo.sh production
- This will create a new empty production database and apply your customizations to it
- This is a critical step. If the build fails, you cannot restore the production database until a successful build completes. This is why testing the procedure in advance (per the options above) is essential.
Restore you production backup
If using OPTION 2 from above, push some/all of your custom modules
If you have a custom domain
- Remove the custom domain from the old production branch, then add it to the new production branch settings.
- Flush your computers local DNS cache to reduce propagation time for yourself, in Windows command line: ipconfig /flushdns
- Browse to the custom domain
- If you see an SSL/TLS certificate error, wait — DNS propagation typically resolves within minutes, though it can take up to 24–48 hours. If the certificate hasn't appeared after an hour or two, remove and re-add the domain to trigger a fresh attempt.
- Test to make sure the bare and the www custom domain is working
- If previously turned on, turn back on the global setting “Block access to the .odoo.com domain”
- Drag your staging branches back from odoo.sh development to odoo.sh staging
- Restore your staging backups (optional)