Command onedb Usage 3.0

:!: Development version of OpenNebula 3.0. The material on this page needs to be reviewed for completeness and accuracy.

The command onedb allows the OpenNebula administrator to manage the SQLite or MySQL database, mainly to perform backups and upgrade the database when OpenNebula is updated to a new version.

Database Connection Parameters

By default, onedb reads reads the connection parameters from oned.conf, parsing the DB variable.

If any of the following options is set, oned.conf is ignored (i.e. if you set MySQL's port onedb won't look for the rest of the options in oned.conf)

SQLite
-s, --sqlite file Path to the DB file, by default it is /var/one/one.db
MySQL
--server host Server hostname or IP. Defaults to localhost
--port port Server port. Defaults to 3306
--user username Username
--passwd password Password. Leave unset to be prompted for it
--dbname name DB name for OpenNebula

Manage Database Version

OpenNebula stores versioning data in a db_versioning table. The database version is an integer number rather than the OpenNebula release version.

The current version can be consulted using the onedb -v version or onedb history commands.

If OpenNebula is started with an existing database containing a different version data, it will fail to start and no harm will be done. The database can be upgraded to the latest installed version using onedb -v upgrade.

Manage Database Backups

The onedb command can perform database backups for both SQLite and MySQL. It can generate a database file copy for SQLite, or a sql dump file for MySQL. You can restore a backup file, but only for the same backend i.e., you can't dump a MySQL DB and restore it into a SQLite file.

You can set a different output file using the --backup option. This option can be used for the onedb restore command as well.