| 44 | |
| 45 | == Backups == |
| 46 | |
| 47 | We recommend backing up your !FlowVisor database, which includes both configuration information and non-transient FV state (FV slices, flowspace rules, etc). |
| 48 | |
| 49 | === Backup === |
| 50 | |
| 51 | There's an fvctl command that saves a JSON version of the DB: |
| 52 | |
| 53 | {{{ |
| 54 | fvctl --passwd-file=/etc/flowvisor.passwd dumpConfig config.json |
| 55 | }}} |
| 56 | |
| 57 | You can then back up this file however you back up other plain files at your site. |
| 58 | |
| 59 | === Restore === |
| 60 | |
| 61 | NOTE that fvconfig can only be run when FlowVisor is '''not running'''. |
| 62 | |
| 63 | NOTE that this completely and irrevocably overwrites your existing FlowVisor database! Use with caution. |
| 64 | |
| 65 | You need to run the restore as the 'flowvisor' user, since that user has the right permissions to create the DB files: |
| 66 | |
| 67 | {{{ |
| 68 | sudo -u flowvisor fvconfig load config.json |
| 69 | }}} |
| 70 | |
| 71 | The last argument is the input file to use, and can be any file name as long as it's readable by the 'flowvisor' user. |
| 72 | |
| 73 | This is generally sufficient, but if your database is in a very bad state, you may need to delete it completely and re-create it before you can load the JSON file: |
| 74 | |
| 75 | {{{ |
| 76 | sudo rm -rf /usr/share/db/flowvisor/FlowVisorDB |
| 77 | sudo -u flowvisor fvconfig generate /dev/null |
| 78 | sudo -u flowvisor fvconfig load config.json |
| 79 | }}} |
| 80 | |
| 81 | In that second step, just hit return when prompted for a password (this will be overwritten by the next step); and ignore the "keytool error" error, it's just telling you that you already have a key pair. |