Closed RachL closed 2 years ago
Documenting my steps. First we need to redirect certificate authentications to the new server:
ansible-playbook --vault-password-file ~/.ansible-vault-password --extra-vars "@../ofn-secrets/fr-prod/secrets.yml" -l fr-prod playbooks/letsencrypt_proxy.yml -e "proxy_target=51.38.38.32"
Then we can change the hosts config file to the new IP address. I also added a swap file. Then provision the new server:
ansible-playbook --vault-password-file ~/.ansible-vault-password --extra-vars "@../ofn-secrets/fr-prod/secrets.yml" -l fr-prod site.yml
The first time you run the provisioning there's always an issue with brotli and nginx. I did two things to resolve this:
libgd-dev
to compile brotli.-t nginx
) which fails but then brotli can be installed successfully and after that this works.This happens with every new server but I never took the time to find an automated solution.
I also had to install db integrations separately:
ansible-playbook --vault-password-file ~/.ansible-vault-password --extra-vars "@../ofn-secrets/fr-prod/secrets.yml" -l fr-prod playbooks/db_integrations.yml
I used steps described in https://github.com/openfoodfoundation/ofn-install/issues/775#issuecomment-1181392722 to activate maintenance mode and copy the database. I encountered #819 but could work around it. Another important detail: clear the cache after the database import.
# ./bin/rails console
Rails.cache.clear
Description
New VPS is here : https://www.ovh.com/manager/#/dedicated/vps/vps-d2442729.vps.ovh.net/dashboard
Migration is scheduled for Monday 19th 2AM CET.
Slack channel fr-upgrade
Acceptance Criteria & Tests