I don't see any other reasons why this could fail... Could you edit /usr/lib/one/ruby/onedb/onedb_backend.rb to output some more info?<br><br>Just add the Exception message to the rescue clause in db_exists?<br><br><span style="font-family: courier new,monospace;"> def db_exists?</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> begin</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> # User with ID 0 (oneadmin) always exists</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> @db.fetch("SELECT * FROM user_pool WHERE oid=0") { |row| }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> return true</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> rescue Exception => e</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> puts e.message</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> return false</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> end</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> end</span><br style="font-family: courier new,monospace;"><br>Thank you<br clear="all"><span style="border-collapse:collapse;color:rgb(136, 136, 136);font-family:arial,sans-serif;font-size:13px">--<br>
Carlos Martín, MSc</span><font color="#888888"><br>Project Engineer</font><br><span style="border-collapse:collapse;color:rgb(136, 136, 136);font-family:arial, sans-serif;font-size:13px"><span style="background-color:rgb(255, 255, 204);color:rgb(34, 34, 34);background-repeat:initial initial">OpenNebula</span> - The Open Source Toolkit for Cloud Computing<br>
<a href="http://www.opennebula.org/" style="color:rgb(42, 93, 176)" target="_blank">www.<span style="background-color:rgb(255, 255, 204);color:rgb(34, 34, 34);background-repeat:initial initial">OpenNebula</span>.org</a> | <a href="mailto:cmartin@opennebula.org" style="color:rgb(42, 93, 176)" target="_blank">cmartin@<span style="background-color:rgb(255, 255, 204);color:rgb(34, 34, 34);background-repeat:initial initial">opennebula</span>.org</a></span><br>
<br><br><div class="gmail_quote">2011/10/18 Ruben Diez <span dir="ltr"><<a href="mailto:rdiez@cesga.es">rdiez@cesga.es</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Yes: it is populated:<br>
<br>
mysql> select * from user_pool where oid=0;<br>
+-----+-----------+-----------<u></u>------------------------------<u></u>-+---------+<br>
| oid | user_name | password | enabled |<br>
+-----+-----------+-----------<u></u>------------------------------<u></u>-+---------+<br>
| 0 | oneadmin | 8944aada99d6d0122494dd0ac8129d<u></u>b653bc1f4a | 1 |<br>
+-----+-----------+-----------<u></u>------------------------------<u></u>-+---------+<br>
1 row in set (0.00 sec)<br>
<br></div>
When you put the "-p" option followed by a blank space you are prompted for the password... in this case "opennebula" is the database name, not the password...<br>
<br>
We can't make onedb backup in the old machine because the onedb command don't exist in OpenNebula 2.1...<br>
<br>
Any way, the onedb backup command seems to be a wrapper of the mysqldump command....<br>
<br>
<br>
<br>
Carlos Martín Sánchez escribió:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hi,<br>
<br>
Is the DB in the new machine correctly populated?<br>
Can you manually perform a "select * from user_pool where oid=0;" ?<br>
<br>
I'm asking because the '-p' option of the mysql commands needs the password right next to it, without any space; i.e. '-popennebula' instead of '-p opennebula'<br>
<br>
<br>
In case any other user is in a similar situation, you can use the onedb command to move the DB to the new mysql server using "onedb backup" and "onedb restore".<br>
<br>
Regards.<br>
--<br>
Carlos Martín, MSc<br>
Project Engineer<br>
OpenNebula - The Open Source Toolkit for Cloud Computing<br>
</div><a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> <<a href="http://www.opennebula.org/" target="_blank">http://www.opennebula.org/</a>> | <a href="mailto:cmartin@opennebula.org" target="_blank">cmartin@opennebula.org</a> <mailto:<a href="mailto:cmartin@opennebula.org" target="_blank">cmartin@opennebula.org</a><u></u>><div>
<div></div><div class="h5"><br>
<br>
<br>
On Tue, Oct 18, 2011 at 12:35 PM, Ruben Diez <<a href="mailto:rdiez@cesga.es" target="_blank">rdiez@cesga.es</a> <mailto:<a href="mailto:rdiez@cesga.es" target="_blank">rdiez@cesga.es</a>>> wrote:<br>
<br>
Hi:<br>
<br>
We are attempt to migrate OpenNebula from 2.1.80 to 3.0....<br>
<br>
But the new 3.0 OpenNebula was installed in a new machine.<br>
<br>
For database migration, we have followed these steps:<br>
<br>
1- In the old machine, we made a dump of the database:<br>
<br>
mysqldump -h localhost -u oneadmin -p opennebula<br>
>opennebula_2_database.mysq<br>
<br>
2- In the new machine, we create the oneadmin user, an empty<br>
opennebula database and grant privileges to user oneadmin on<br>
database opennebula:<br>
<br>
mysql> create user 'oneadmin'@'localhost' identified by 'XXXXX';<br>
mysql> create database opennebula;<br>
mysql> grant all privileges on opennebula.* to 'oneadmin'@'localhost';<br>
<br>
3- Now, in the new machine, we restore the 2.1 version database:<br>
<br>
mysql -h localhost -u oneadmin -p opennebula<br>
<opennebula_2_database.mysql<br>
<br>
4- The configuration of the database is set in the oned.conf file:<br>
<br>
DB = [ backend = "mysql",<br>
server = "localhost",<br>
port = 0,<br>
user = "oneadmin",<br>
passwd = "XXXXX",<br>
db_name = "opennebula" ]<br>
<br>
5- Now, we attempt the database conversion: but it fails:<br>
<br>
#oneadmin@onesrv04:/srv/cloud$ onedb upgrade -v Database schema does not look to be created by<br>
OpenNebula: table user_pool is missing or empty.<br>
<br>
<br>
We attempt to avoid oned.conf file, but also fails:<br>
<br>
#oneadmin@onesrv04:/srv/cloud$ onedb upgrade -v -u oneadmin -d<br>
opennebula MySQL Password:<br>
MySQL option DBNAME is needed<br>
<br>
#oneadmin@onesrv04:/srv/cloud$ onedb upgrade -v -u root -d opennebula<br>
MySQL Password:<br>
MySQL option DBNAME is needed<br>
<br>
#oneadmin@onesrv04:/srv/cloud$ onedb upgrade -v -P 3306 -S<br>
localhost -u oneadmin -d opennebula<br>
MySQL Password:<br>
MySQL option DBNAME is needed<br>
<br>
<br>
Any ideas about why the database migration fails??<br>
<br>
Regards....<br>
<br>
______________________________<u></u>_________________<br>
Users mailing list<br></div></div>
<a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a> <mailto:<a href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.<u></u>opennebula.org</a>><br>
<a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/<u></u>listinfo.cgi/users-opennebula.<u></u>org</a><br>
<br>
<br>
</blockquote>
<br>
</blockquote></div><br>