Skip to content

Commit

Permalink
Merge pull request #964 from dacook/upgrade-updates
Browse files Browse the repository at this point in the history
Upgrade updates
  • Loading branch information
mkllnk authored Nov 21, 2024
2 parents eec96a8 + faba0ba commit 1980182
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions .github/ISSUE_TEMPLATE/server-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ assignees: ''
Checklist based on general guide https://github.com/openfoodfoundation/ofn-install/wiki/Migrating-a-Production-Server

## 1. Setting up the new server
- [ ] Check old server config for any additional services to be aware of (eg `/etc/nginx/sites-available`). Document any necessary steps for migration.
- [ ] Check old server config for any additional services to be aware of. Document any necessary steps for migration. Eg:
- `ls /etc/nginx/sites-enabled`
- `systemctl --state=running`
- [ ] Hosting: provision new server with Ubuntu 20
- [ ] DNS: add temporary domain (eg `prod2.openfoodnetwork.org`)

Expand All @@ -27,7 +29,7 @@ Enable passthrough on _current_ server to allow new server to generate a certifi
- [ ] `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/`
`ansible-playbook -l x_prod2 -e "@../ofn-secrets/x_prod/secrets.yml" playbooks/`
- [ ] `setup.yml`
- [ ] `provision.yml`
- [ ] `deploy.yml`
Expand All @@ -42,6 +44,9 @@ Then setup new server. Ensure you have the correct secrets (current secrets are
- [ ] `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
- [ ] test `reboot`
- [ ] send test mail (`/admin/mail_methods/edit`).
Expand All @@ -55,7 +60,7 @@ Then setup new server. Ensure you have the correct secrets (current secrets are

## 3. Migration
### preparation
- [ ] new server: `bundle exec rake db:reset -e production`
- [ ] **new server**: `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
- [ ] old server: make a tiny data change to verify later (eg add `.` in meta description `/admin/general_settings/edit`)

Expand Down
2 changes: 1 addition & 1 deletion roles/default_user/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- name: create deploy user
user:
name="{{ user }}"
groups=adm,dialout,cdrom,floppy,audio,dip,video,plugdev,netdev,sudo
groups=adm,dialout,cdrom,floppy,audio,dip,video,plugdev,sudo
append=yes
state=present
shell=/bin/bash
Expand Down

0 comments on commit 1980182

Please sign in to comment.