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
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
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
bin/rake db:reset -e production
(important: make sure you're on the new server!)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: