Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate FR prod on new server #825

Closed
RachL opened this issue Sep 15, 2022 · 4 comments
Closed

Migrate FR prod on new server #825

RachL opened this issue Sep 15, 2022 · 4 comments
Assignees

Comments

@RachL
Copy link
Contributor

RachL commented Sep 15, 2022

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

  1. FR prod is running on at least Ubuntu 20
  2. FR prod is running on a server with swap and 16 giga RAM
@mkllnk
Copy link
Member

mkllnk commented Sep 26, 2022

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

@mkllnk
Copy link
Member

mkllnk commented Sep 26, 2022

The first time you run the provisioning there's always an issue with brotli and nginx. I did two things to resolve this:

  1. I installed libgd-dev to compile brotli.
  2. I ran the nginx install first (with -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.

@mkllnk
Copy link
Member

mkllnk commented Sep 26, 2022

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

@mkllnk
Copy link
Member

mkllnk commented Sep 26, 2022

I used steps described in #775 (comment) 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants