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
local file, eg terms of service file: /admin/terms_of_service_files
shop catalogue display correctly, with images, add to cart, begin checkout, login
note: check cookies if login won't work
Check integrations
Payments (check Stripe connect status /admin/stripe_connect_settings/edit)
New Relic
Bugsnag
3. Migration
preparation
Reset database on new server, to avoid any migration issues due to being out of sync bin/rake db:reset (You will need to confirm. Make sure you're on the new server!)
deploy.yml -l x_prod2 -e "git_version=vX.Y.Z" matching version with current prod
old server: make a tiny data change to verify later (eg add . in meta description /admin/general_settings/edit)
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
bin/rake db:reset
(You will need to confirm. 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
ansible-playbook playbooks/maintenance_mode.yml -l x_prod
sudo systemctl stop sidekiq redis-jobs puma
/var/lib/redis-jobs/dump.rdb
to new server (see guide)ansible-playbook -l x_prod -e rsync_to=x_prod2 playbooks/db_transfer.yml
~3minsudo systemctl stop postgres
(ensure other integrations no longer touch it)ansible-playbook -l x_prod -e rsync_to=x_prod2 playbooks/transfer_assets.yml
just in caseswitchover: 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/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: