| 1 | Upgrading to FOAM 0.8 from FOAM 0.6 involves a database conversion; here's an end-to-end procedure for upgrading and testing. |
| 2 | |
| 3 | Get before state: |
| 4 | |
| 5 | {{{ |
| 6 | cd |
| 7 | rm -rf ~/tmp/foam-upgrade |
| 8 | mkdir -p ~/tmp/foam-upgrade/before |
| 9 | cd ~/tmp/foam-upgrade/before |
| 10 | |
| 11 | foamctl list-slivers --passwd-file=/opt/foam/etc/foampasswd > list-slivers-active.txt |
| 12 | foamctl list-slivers --deleted --passwd-file=/opt/foam/etc/foampasswd > list-slivers-deleted.txt |
| 13 | |
| 14 | egrep '(email|desc|slice_urn|sliver_urn)' list-slivers-active.txt | sort > list-slivers-active-cooked.txt |
| 15 | egrep '(email|desc|slice_urn|sliver_urn)' list-slivers-deleted.txt | sort > list-slivers-deleted-cooked.txt |
| 16 | }}} |
| 17 | |
| 18 | Update the apt sources entry to 'deb https://s3.amazonaws.com/bssoftworks/foam-pkg/ lucid/stable/all/'. |
| 19 | |
| 20 | Make sure it's available: |
| 21 | |
| 22 | {{{ |
| 23 | sudo apt-get update |
| 24 | apt-cache show foam | grep "^Version" |
| 25 | }}} |
| 26 | |
| 27 | Do what https://openflow.stanford.edu/display/FOAM/0.8+Upgrade+Instructions says: |
| 28 | |
| 29 | {{{ |
| 30 | cp /opt/foam/db/foam.db ~/foam.db.bak |
| 31 | cp /opt/foam/db/foam.db /tmp/foam.db |
| 32 | sudo apt-get install -y --force-yes foam |
| 33 | sudo service foam restart |
| 34 | sudo service nginx restart |
| 35 | foam-db-convert.py | tee ~/foam-db-convert.log |
| 36 | }}} |
| 37 | |
| 38 | At the end of foam-db-convert.py, it'll prompt you for a new admin password. You can use the same thing as you had before (e.g. the one in /opt/foam/etc/foampasswd, if you had it stashed there) -- it's just that it got reset to 'admin' when the new 0.8.x database was created. |
| 39 | |
| 40 | Note that foam-db-convert.py is importing deleted slivers, so if e.g. experimenters created and deleted slivers in the same '''slice''' repeatedly, you may see a bunch of what looks like duplicates. The '''slice''' URNs may be the same, but the '''sliver''' URNs should be different. |
| 41 | |
| 42 | Get "after" state: |
| 43 | |
| 44 | {{{ |
| 45 | cd |
| 46 | rm -rf ~/tmp/foam-upgrade/after |
| 47 | mkdir -p ~/tmp/foam-upgrade/after |
| 48 | cd ~/tmp/foam-upgrade/after |
| 49 | |
| 50 | foamctl geni:list-slivers --passwd-file=/opt/foam/etc/foampasswd > list-slivers-active.txt |
| 51 | foamctl geni:list-slivers --deleted --passwd-file=/opt/foam/etc/foampasswd > list-slivers-deleted.txt |
| 52 | |
| 53 | egrep '(email|desc|slice_urn|sliver_urn)' list-slivers-active.txt | sort > list-slivers-active-cooked.txt |
| 54 | egrep '(email|desc|slice_urn|sliver_urn)' list-slivers-deleted.txt | sort > list-slivers-deleted-cooked.txt |
| 55 | }}} |
| 56 | |
| 57 | Diff the results: |
| 58 | |
| 59 | {{{ |
| 60 | for file in *cooked.txt ; do diff -u ../before/$file $file ; done |
| 61 | }}} |
| 62 | |
| 63 | Check for any other exceptions: |
| 64 | |
| 65 | {{{ |
| 66 | grep -i exception /opt/foam/log/foam.log |
| 67 | }}} |
| 68 | |
| 69 | You can also look through ~/foam-db-convert.log if you want to see what all it did, skim for anything unusual, etc. Not essential, if you feel happy. |