You have several options depending on how you want to combine actions (like 5.0.8 > 5.0.9 & NE > FOSS switch in 1 or 2 phases) - if something should go wrong it's often easier to troubleshoot spread out steps. Platforms you can change 'easier' you can't downgrade ZCS version's easily. Take backups of course.
Platform change methods:
A) NE backup/restore
Backup and Restore /
Network Edition Disaster Recovery - Zimbra :: Wiki (changing servers)
B) ./install -s trick (using rsync or other backup method)
Moving ZCS to Another Server » Zimbra :: Blog (see step 3)
Also have to decide if you want to do new Ubuntu 8.04 install or
Ubuntu 6.06 > 8.04 in-place upgrade
Options:
5.0.8 NE > Platform change > 5.0.8 NE > 5.0.9 NE > 5.0.9 FOSS
5.0.8 NE > Platform change > 5.0.8 NE > 5.0.9 FOSS
5.0.8 NE > 5.0.9 NE > Platform change > 5.0.9 NE > 5.0.9 FOSS
5.0.8 NE > 5.0.9 NE > 5.0.9 FOSS > Platform change (NE method not possible) > 5.0.9 FOSS
5.0.8 NE > 5.0.9 FOSS > Platform change (NE method not possible) > 5.0.9 FOSS