You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 -e ansible_user=ubuntu
provision.yml
deploy.yml
db_integrations (Permit DB access for n8n, Metabase)
initial migration
Ensure sidekiq is disabled, to avoid creating subscription orders when data is loaded: sudo systemctl stop sidekiq && sudo systemctl disable sidekiq
Setup direct ssh access for ofn-admin and openfoodnetwork as per guide
Checklist based on general guide https://github.com/openfoodfoundation/ofn-install/wiki/Migrating-a-Production-Server
1. Setting up the new server
/etc/nginx/sites-available
). Document any necessary steps for migration.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=<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 -e ansible_user=ubuntu
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
2. Testing
reboot
/admin/mail_methods/edit
)./admin/terms_of_service_files
/admin/stripe_connect_settings/edit
)3. Migration
preparation
bundle exec rake db:reset -e production
deploy.yml -l x_prod2 -e "git_version=vX.Y.Z"
matching version with current prod.
in meta description/admin/general_settings/edit
)switchover: old server
maintenance_mode.yml
sudo systemctl stop sidekiq redis-jobs puma
/var/lib/redis-jobs/dump.rdb
to new server (see guide)db_transfer.yml
~3minsudo systemctl stop postgres
(ensure other integrations no longer touch it)transfer_assets.yml
just in caseswitchover: new server
sudo systemctl restart puma; sudo systemctl start sidekiq redis-jobs
Rails.cache.clear
(or migrate redis-cache/dump.rdb also)temporary_proxy.yml -e 'proxy_target=<ip>'
redirect traffic to new prodhosts
file entry to test a direct connection~/apps/openfoodnetwork/current/logs/production.log
andsidekiq.log
4. Cleanup (after 48hrs)
provision.yml
still works. This will rename x-prod2 to x-prodRollback plan
The text was updated successfully, but these errors were encountered: