Changes between Version 54 and Version 55 of OpenFlow/FOAM

07/10/13 07:48:27 (8 years ago)
Josh Smift



  • OpenFlow/FOAM

    v54 v55  
    155155If you run !FlowVisor on a different server, you'd want to run the second command there instead.
     157== Backups ==
     159We recommend backing up your FOAM databases, which includes both configuration information and FOAM sliver data.
     161=== Backup ===
     163This sequence of commands will save your various FOAM .db files as .sql files. It can be run while FOAM is running or stopped, as you like.
     165First, set $DUMPDIR to a directory where you (or the user you're running this as, e.g. if you're running it out of cron) have write permissions, and make sure the directory exists:
     169mkdir -p $DUMPDIR
     172Then, dump all of the .db files in /opt/foam/db into .sql files in your dump directory:
     175cd /opt/foam/db
     176for dbfile in $(ls *.db)
     178  dbname=$(basename $dbfile .db)
     179  sqlite3 $dbfile .dump > $DUMPDIR/$dbname.sql
     183Now you can back up those .sql files with whatever method you prefer for backing up normal text files.
     185=== Restore ===
     187NOTE that this completely and irrevocably overwrites your existing FOAM databases! Use with caution.
     189NOTE that this should only be done when FOAM is '''not running'''. First, do:
     192sudo service foam stop
     195You need to run the restore as the 'www-data' user, since that user has the right permissions to create the DB files.
     197Put the .sql files to restore into an otherwise-empty directory, change into that directory, and run:
     200for sqlfile in $(ls *.sql)
     202  dbname=$(basename $sqlfile .sql)
     203  sudo -u www-data rm -f /opt/foam/db/$dbname.db
     204  sudo -u www-data sqlite3 /opt/foam/db/$dbname.db ".read $dbname.sql"
     208Then start up FOAM:
     211sudo service foam start
     214You should then do some sanity checks to make sure things look like you expect.
    157216== Upgrading ==