Move from SaaS to SH - odoo-ps/psbe-process GitHub Wiki

Test phase

Create new repo on odoo-ps

  • Create a new repo psOFFICE-CLIENT_NAME within odoo-ps github organization where
    • OFFICE should be [be, lu, us, hk] depending on which office manages the project
    • CLIENT_NAME should be the name of the client without any special char or accent or capital letter
    • Example: for the Belgian client "la fabrique givrée" create a repo psbe-lafabriquegivree or psbe-la-fabrique-givree
    • There is a team for each office (PSBE (for be and lu, look for "odoo-ps/psbe"), PSUS, PSIN, ...). Add the corresponding team as admin of the repo in order to allow you colleague to access the repo as well.

Create SH project

  • Go on odoo.sh, log in and create a new project
  • Choose an existing repository: The one you just created
  • Use the client subscription, choose the server region according to the client localization
    • By default client from BE and LU will be in Europe, HK is Asia and US is Americas
  • Add the functional consultant as admin in the settings
  • For psbe project add mva-odoo as admin as well

Create and update branch

  • Create one other branche
    • staging branch named with version number by e.g. 13.0-staging
  • Put the branch in the right stage on SH (master in production and staging branch in staging)
  • On the production branch load a dump from the saas DB. Be careful, execute the Neutralization script straight after!

Transfert branch from ps-cutom to new repo

  1. Create a copy of ps-custom in folder ps-custom_bis
git clone [email protected]:odoo/ps-custom.git ps-custom_bis 
  1. Go into this folder
cd ps-custom_bis
  1. Checkout the branch you want to copy
git checkout <branch_to_copy>
  1. Change the remote url to your new repo
git remote set-url origin [email protected]:odoo-ps/psbe-agence-du-numerique.git
  1. Push the branch on your new repo
git push

You can also change the name of the branch transferred

  1. Checkout the branch transferred
git checkout <branch_transferred>
  1. Change name locally to for example 12.0-module_saas_backup
git branch -m <new_name>
  1. Set new upstream
git push origin -u <new_name>
  1. Delete old name remote branch:
git push origin --delete <old_name>

After that you can delete the folder ps-custom_bis from your computer. You now have previous dev with historic on the new repository.

Go to prod

Unlink the domain:

  1. connect on accounts.odoo.com as admin : admin_login + trgramme/pw
  2. Go into my/databases
  3. Connect to the DB as admin
  4. Click on screw and domains
  5. Delete the domain example: www.activegear.eu

If for some reason you cannot rename it, you can add this /saas_worker/rename?to= to the URL to do it

Download the dump

  1. Go to db/_odoo/support
  2. Download dump: db/_odoo/support/dump.zip
  3. Note the email limit. You'll need it later
  4. Go back to accounts.odoo.com
  5. Rename the saas db
  • OPTIONNAL if the transfer might take time ad you need to lock the db, for an estore for example
  1. Ask saas team to lock db (Maybe good to warn them before)

Import Dump

  1. Go to sh
  2. Change project name, example: active-gear
  3. Load the dump through the interface into the production branch

Set up the domain

  1. Open the settings of the production branch
  2. Add the custom domain previously deleted

Unlink saas db and link sh db to the contract

  1. Go into odoo.com
  2. Look for the Saas database in Subscriptions/Databases/Databases and put the field Contract to False
  3. Go to the new Odoo.sh production _odoo/support page and trigger a ping to automatically link the db with the subscription
  4. Check that the correct database is linked to the subscription
  5. Set up the Email limit on support page (same as in saas)
  6. Connect to the DB and check every thing is fine
⚠️ **GitHub.com Fallback** ⚠️