-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
[Upgrade Ubuntu] us_prod #965
Comments
There are some subdomains pointing to the server (see Cloudflare DNS), but they appear to be simple redirects (probably set up in nginx)
|
Yep! Cloudflare gives us three redirects and we only use two. We use them a good amount. |
Thank you David! You are the best!! One tiny non urgent question awaits in your email. |
Checked access logs before shutting down old server. Just bots scanning for vulnerabilities (and.. guacamole?)
I hope they find what they're looking for. |
Hi @lauriewayne just confirming I have shutdown the old server 🖥️ 💤 . You can delete it when you're ready. |
We will have a moment of gratitude to the old server for its years of service, and to you @dacook or helping us safely move into the future! Then that old droplet is gone! 💧 👋 🙏 (I will also remove that bowl of guacamole we left laying around after the last party) 🥑 |
Slack thread: #instance-managers
1. Setting up the new server
ls /etc/nginx/sites-enabled
systemctl --state=running
prod2.openfoodnetwork.org
)config
inventory/hosts
host_vars/x/config.yml
, clean up if neededcertbot_domains
ofn-secrets:x_prod/secrets.yml
, clean up if neededsetup
Enable passthrough on current server to allow new server to generate a certificate:
ansible-playbook playbooks/letsencrypt_proxy.yml -l x_prod -e "proxy_target=<new_ip>"
Then setup new server. Ensure you have the correct secrets (current secrets are usually fine).
ansible-playbook -l x_prod2 -e "@../ofn-secrets/x_prod/secrets.yml" playbooks/
setup.yml
provision.yml
deploy.yml
db_integrations
(Permit DB access for n8n, Metabase)initial migration
sudo systemctl stop sidekiq && sudo systemctl disable sidekiq
ofn-admin
andopenfoodnetwork
as per guideansible-playbook -l x_prod -e rsync_to=x_prod2 playbooks/
db_transfer.yml
transfer_assets.yml
Make sure to clear cache so that instance settings are applied:
cd ~/apps/openfoodnetwork/current; bin/rails runner -e production "Rails.cache.clear"
2. Testing
reboot
/admin/mail_methods/edit
)./admin/terms_of_service_files
/admin/stripe_connect_settings/edit
)3. Migration
preparation
sudo -u postgres psql
(Make sure you're on the new server!) To avoid any migration issues due to being out of sync, or jobs running in sidekiq.inventory/hosts
and ensure provision works (this should update host in.env.production
and enable sidekiq again).ansible-playbook playbooks/provision.yml -l x_prod
ansible-playbook playbooks/deploy.yml -l x_prod -e "git_version=vX.Y.Z"
matching version with current prod.
in meta description/admin/general_settings/edit
)switchover: old server
ansible-playbook playbooks/maintenance_mode.yml -l x_prod
sudo systemctl stop sidekiq redis-jobs puma
ansible-playbook -l x_prod -e rsync_to=x_prod2 playbooks/db_transfer.yml &&
ansible-playbook -l x_prod -e rsync_to=x_prod2 playbooks/transfer_assets.yml
/var/lib/redis-jobs/dump.rdb
to new server (see guide)sudo systemctl stop postgresql
(ensure other integrations no longer touch it)switchover: new server
sudo systemctl restart puma; sudo systemctl start sidekiq redis-jobs
cd ~/apps/openfoodnetwork/current; bin/rails runner -e production "Rails.cache.clear"
(or migrate redis-cache/dump.rdb also)ansible-playbook -l x_prod playbooks/temporary_proxy.yml -e 'proxy_target=<new_ip>'
redirect traffic to new prodhosts
file entry to test a direct connection~/apps/openfoodnetwork/current/log/production.log
andsidekiq.log
4. Cleanup (after 48hrs)
check metabase sync if required: https://data.openfoodnetwork.org.uk/admin/databases/Rollback plan
The text was updated successfully, but these errors were encountered: