<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); ">
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">I have found one possible solution</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">I modified <span class="Apple-style-span" style="font-size: medium; ">/usr/lib/one/ruby/onedb/3.8.5_to_3.9.30.rb as follows;</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span class="Apple-style-span" style="font-size: medium; "><br>
</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span class="Apple-style-span" style="font-size: medium; ">
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> @db.fetch("SELECT * FROM old_template_pool") do |row|</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> doc = Document.new(row[:body])</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> template = nil</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> doc.root.each_element("TEMPLATE") do |e|</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> template = e</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> end</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> doc.root.each_element("TEMPLATE") do |e|</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> elem = e.delete_element("REQUIREMENTS")</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> if !elem.nil?</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> template.add_element("SCHED_REQUIREMENTS").text = elem.text</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> end</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> elem = e.delete_element("RANK")</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> if !elem.nil?</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> template.add_element("SCHED_RANK").text = elem.text</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> end</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "># NEW> e.add_element("CPU").text = "1"</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "> end</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "># NEW> doc.root.each_element("TEMPLATE/GRAPHICS") { |e|</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "># NEW> e.delete_element("PORT")</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "># NEW > }</div>
<div><br>
</div>
</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span class="Apple-style-span" style="font-size: medium; "><br>
</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span class="Apple-style-span" style="font-size: medium; ">The second part to delete PORT works!</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span class="Apple-style-span" style="font-size: medium; "><br>
</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span class="Apple-style-span" style="font-size: medium; ">The issue is the first part. With the above code, the body field of template_pool shows a new entry </span><span class="Apple-style-span" style="font-size: medium; "><CPU>1</CPU> </span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span class="Apple-style-span" style="font-size: medium; ">while I expect it to be <CPU><![CDATA[1]]></CPU></span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span class="Apple-style-span" style="font-size: medium; "><br>
</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span class="Apple-style-span" style="font-size: medium; ">So, I am thinking of modifying as follows instead;</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><span class="Apple-style-span" style="font-size: medium; "> e.add_element("CPU").text = "<![CDATA[1]]>"</span></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">I believe this will result in the DB as <CPU><![CDATA[1]]></CPU></div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">What do you ON developers think?</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">Thanks,</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">Hyunwoo</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; ">FermiCloud</div>
<div style="font-family: Calibri, sans-serif; font-size: 14px; "><br>
</div>
<span id="OLK_SRC_BODY_SECTION" style="font-size: 14px; font-family: Calibri, sans-serif; ">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Hyunwoo Kim <<a href="mailto:hyunwoo@fnal.gov">hyunwoo@fnal.gov</a>><br>
<span style="font-weight:bold">Date: </span>Tuesday, April 15, 2014 10:08 AM<br>
<span style="font-weight:bold">To: </span>users <<a href="mailto:users@lists.opennebula.org">users@lists.opennebula.org</a>><br>
<span style="font-weight:bold">Cc: </span>Hyunwoo Kim <<a href="mailto:hyunwoo@fnal.gov">hyunwoo@fnal.gov</a>><br>
<span style="font-weight:bold">Subject: </span>onedb upgrade and XML<br>
</div>
<div><br>
</div>
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif; ">
<div>Hello,</div>
<div><br>
</div>
<div>onedb upgrade command of ON44 against an old DB</div>
<div>fails to do the following two tasks.</div>
<div>1. <CPU> </CPU> should have been inserted, but missing</div>
<div>2. <PORT> </PORT> in /VMTEMPLATE/TEMPLATE/GRAPHICS/ should have been removed, but still there..</div>
<div><br>
</div>
<div>What should I do about these?</div>
<div><br>
</div>
<div>I am investigating a possibility to use xpath command </div>
<div>with mysql -h localhost -u root -e "select body from template_pool limit 1" open nebula</div>
<div>or something, but I am not sure if this is any good solution..</div>
<div><br>
</div>
<div>Any advice will be very appreciated.</div>
<div>Thanks,</div>
<div><br>
</div>
<div>Hyunwoo KIM</div>
<div>FermiCloud</div>
<div><br>
</div>
<div><br>
</div>
</div>
</div>
</span>
</body>
</html>