[one-users] Convert OpenNebula DB from sqlite to MySQL

Carlos Martín Sánchez cmartin at opennebula.org
Fri Oct 26 04:16:34 PDT 2012


Hi Vladislav,

Thank you for this recipe. I've put a link to it in our community wiki [1]
to make it easier to find for other users.

Cheers!

[1] http://wiki.opennebula.org/
--
Carlos Martín, MSc
Project Engineer
OpenNebula - The Open-source Solution for Data Center Virtualization
www.OpenNebula.org | cmartin at opennebula.org |
@OpenNebula<http://twitter.com/opennebula><cmartin at opennebula.org>



On Fri, Oct 26, 2012 at 1:38 AM, Vladislav Gorbunov <vadikgo at gmail.com>wrote:

> Manual for convert OpenNebula DB from sqlite to MySQL:
>
> http://vadikgo.tumblr.com/post/34325489321/convert-opennebula-db-from-sqlite-to-mysql
>
> Create MySQL database opennebula, grant access to user oneadmin with
> password onepass
>
> Get convert script sqlite2mysql.pl from the
>
> http://stackoverflow.com/questions/18671/quick-easy-way-to-migrate-sqlite3-to-mysql
>
> Stop oned:
> service oned stop
>
> Dump sqlite database to file:
> sqlite3 /var/lib/one/one.db .dump | ./sqlite2mysql.pl > mysql.sql
>
> Remove first line PRAGMA foreign_keys=OFF; from the mysql.sql
>
> Load sql data to database:
> mysql -u oneadmin -p opennebula < mysql.sql
>
> Change /etc/one/oned.conf from
> DB = [ backend = "sqlite" ]
> to
> DB = [ backend = "mysql",
>         server  = "localhost",
>         port    = 0,
>         user    = "oneadmin",
>         passwd  = "onepass",
>         db_name = "opennebula" ]
>
> Check MySQL database:
> onedb fsck -v -S localhost -u oneadmin -p onepass -d opennebula
>
> Start oned:
> service oned start
> _______________________________________________
> Users mailing list
> Users at lists.opennebula.org
> http://lists.opennebula.org/listinfo.cgi/users-opennebula.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opennebula.org/pipermail/users-opennebula.org/attachments/20121026/944a63cf/attachment-0002.htm>


More information about the Users mailing list