wiki:OpenFlow/FOAM/UpgradingTo0.8

Version 1 (modified by Josh Smift, 7 years ago) (diff)

--

Upgrading to FOAM 0.8 from FOAM 0.6 involves a database conversion; here's an end-to-end procedure for upgrading and testing.

Get before state:

cd
rm -rf ~/tmp/foam-upgrade
mkdir -p ~/tmp/foam-upgrade/before
cd ~/tmp/foam-upgrade/before

foamctl list-slivers --passwd-file=/opt/foam/etc/foampasswd > list-slivers-active.txt
foamctl list-slivers --deleted --passwd-file=/opt/foam/etc/foampasswd > list-slivers-deleted.txt

egrep '(email|desc|slice_urn|sliver_urn)' list-slivers-active.txt | sort > list-slivers-active-cooked.txt
egrep '(email|desc|slice_urn|sliver_urn)' list-slivers-deleted.txt | sort > list-slivers-deleted-cooked.txt

Update the apt sources entry to 'deb https://s3.amazonaws.com/bssoftworks/foam-pkg/ lucid/stable/all/'.

Make sure it's available:

sudo apt-get update
apt-cache show foam | grep "^Version"

Do what https://openflow.stanford.edu/display/FOAM/0.8+Upgrade+Instructions says:

cp /opt/foam/db/foam.db ~/foam.db.bak
cp /opt/foam/db/foam.db /tmp/foam.db
sudo apt-get install -y --force-yes foam
sudo service foam restart
sudo service nginx restart
foam-db-convert.py | tee ~/foam-db-convert.log

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.

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.

Get "after" state:

cd
rm -rf ~/tmp/foam-upgrade/after
mkdir -p ~/tmp/foam-upgrade/after
cd ~/tmp/foam-upgrade/after

foamctl geni:list-slivers --passwd-file=/opt/foam/etc/foampasswd > list-slivers-active.txt
foamctl geni:list-slivers --deleted --passwd-file=/opt/foam/etc/foampasswd > list-slivers-deleted.txt

egrep '(email|desc|slice_urn|sliver_urn)' list-slivers-active.txt | sort > list-slivers-active-cooked.txt
egrep '(email|desc|slice_urn|sliver_urn)' list-slivers-deleted.txt | sort > list-slivers-deleted-cooked.txt

Diff the results:

for file in *cooked.txt ; do diff -u ../before/$file $file ; done

Check for any other exceptions:

grep -i exception /opt/foam/log/foam.log

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.