{"id":929,"date":"2015-10-15T08:04:56","date_gmt":"2015-10-15T08:04:56","guid":{"rendered":"https:\/\/www.taywa.ch\/blog\/?p=929"},"modified":"2015-10-15T08:38:55","modified_gmt":"2015-10-15T08:38:55","slug":"pi_flexform-felder-typo3-datenbank-migrieren-mysql","status":"publish","type":"post","link":"https:\/\/www.taywa.ch\/blog\/mysql\/pi_flexform-felder-typo3-datenbank-migrieren-mysql\/","title":{"rendered":"pi_flexform Felder in der Typo3 Datenbank migrieren (direkt mit MySQL)"},"content":{"rendered":"<p>bei der migration von Typo3 4.5 auf 6.2 kommt es vor, dass die konfiguration der inhalte (im feld pi_flexform gespeichert) umformatiert werden muss, da sich zb. beim redereing von <strong>media inhaltselementen<\/strong> einiges ge\u00e4ndert hat.<\/p>\n<p>gl\u00fccklicherweise kann man in der MySQL abfrage direkt XPATH selektionen mit der funktion <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/xml-functions.html\" title=\"MySQL Extractvalue Referenz\">ExtractValue<\/a> machen. mit CONCAT kann man dann das neue pi_flexform XML wieder zusammensetzten.<\/p>\n<p>hier ein beispiel zum aktualisieren der media elemente vom typ audio:<\/p>\n<div class=\"mysql dean_ch\"><a href=\"http:\/\/search.mysql.com\/search?site=refman-%35%31&amp;q=UPDATE\"><span class=\"kw1\">UPDATE<\/span><\/a> <span class=\"st0\">`typo3-datenbank`<\/span>.<span class=\"st0\">`tt<span class=\"es1\">_<\/span>content`<\/span> <a href=\"http:\/\/search.mysql.com\/search?site=refman-%35%31&amp;q=SET\"><span class=\"kw1\">SET<\/span><\/a> <span class=\"st0\">`pi<span class=\"es1\">_<\/span>flexform`<\/span> <span class=\"sy1\">=<\/span> <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/%35%2E%31\/en\/string-functions.html\"><span class=\"kw13\">CONCAT<\/span><\/a><span class=\"br0\">&#40;<\/span><span class=\"st0\">&#8218;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; standalone=&quot;yes&quot; ?&gt;<br \/>\n&lt;T3FlexForms&gt;<br \/>\n&nbsp; &nbsp; &lt;data&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;sheet index=&quot;sGeneral&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;language index=&quot;lDEF&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field index=&quot;mmType&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value index=&quot;vDEF&quot;&gt;audio&lt;\/value&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/field&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field index=&quot;mmUseHTML5&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value index=&quot;vDEF&quot;&gt;0&lt;\/value&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/field&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field index=&quot;mmWidth&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value index=&quot;vDEF&quot;&gt;&lt;\/value&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/field&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field index=&quot;mmHeight&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value index=&quot;vDEF&quot;&gt;&lt;\/value&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/field&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field index=&quot;mmRenderType&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value index=&quot;vDEF&quot;&gt;auto&lt;\/value&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/field&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/language&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;\/sheet&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;sheet index=&quot;sVideo&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;language index=&quot;lDEF&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field index=&quot;mmFile&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value index=&quot;vDEF&quot;&gt;&lt;\/value&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/field&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/language&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;\/sheet&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;sheet index=&quot;sAudio&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;language index=&quot;lDEF&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field index=&quot;mmAudioFallback&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value index=&quot;vDEF&quot;&gt;&#8216;<\/span><span class=\"sy2\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br \/>\n<a href=\"http:\/\/dev.mysql.com\/doc\/refman\/%35%2E%31\/en\/func-op-summary-ref.html\"><span class=\"kw25\">ExtractValue<\/span><\/a><span class=\"br0\">&#40;<\/span>pi_flexform<span class=\"sy2\">,<\/span> <span class=\"st0\">&#8218;\/\/sheet[@index=&quot;sAudio&quot;]\/\/value&#8216;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy2\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"st0\">&#8218;&lt;\/value&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/field&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field index=&quot;mmAudioSources&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;el index=&quot;el&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;section index=&quot;1&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;itemType index=&quot;mmAudioSourcesContainer&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;el&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field index=&quot;mmAudioSource&quot;&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value index=&quot;vDEF&quot;&gt;&#8216;<\/span><span class=\"sy2\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br \/>\n<a href=\"http:\/\/dev.mysql.com\/doc\/refman\/%35%2E%31\/en\/func-op-summary-ref.html\"><span class=\"kw25\">ExtractValue<\/span><\/a><span class=\"br0\">&#40;<\/span>pi_flexform<span class=\"sy2\">,<\/span> <span class=\"st0\">&#8218;\/\/sheet[@index=&quot;sAudio&quot;]\/\/value&#8216;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy2\">,<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br \/>\n<span class=\"st0\">&#8218;&lt;\/value&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/field&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/el&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/itemType&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;itemType index=&quot;<span class=\"es1\">_<\/span>TOGGLE&quot;&gt;0&lt;\/itemType&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/section&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/el&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/field&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/language&gt;<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &lt;\/sheet&gt;<br \/>\n&nbsp; &nbsp; &lt;\/data&gt;<br \/>\n&lt;\/T3FlexForms&gt;&#8216;<\/span> <span class=\"br0\">&#41;<\/span> <a href=\"http:\/\/search.mysql.com\/search?site=refman-%35%31&amp;q=WHERE\"><span class=\"kw1\">WHERE<\/span><\/a> <span class=\"st0\">`tt<span class=\"es1\">_<\/span>content`<\/span>.<span class=\"st0\">`CType`<\/span><span class=\"sy1\">=<\/span><span class=\"st0\">&#8218;media&#8216;<\/span><br \/>\n&nbsp;<\/div>\n","protected":false},"excerpt":{"rendered":"<p>bei der migration von Typo3 4.5 auf 6.2 kommt es vor, dass die konfiguration der inhalte (im feld pi_flexform gespeichert) umformatiert werden muss, da sich zb. beim redereing von media inhaltselementen einiges ge\u00e4ndert hat. gl\u00fccklicherweise kann man in der MySQL abfrage direkt XPATH selektionen mit der funktion ExtractValue machen. mit CONCAT kann man dann das<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,166],"tags":[170,185,180],"class_list":["post-929","post","type-post","status-publish","format-standard","hentry","category-mysql","category-typo3-upgrade","tag-migration","tag-mysql","tag-typo3"],"_links":{"self":[{"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts\/929","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/comments?post=929"}],"version-history":[{"count":4,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts\/929\/revisions"}],"predecessor-version":[{"id":933,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/posts\/929\/revisions\/933"}],"wp:attachment":[{"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/media?parent=929"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/categories?post=929"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.taywa.ch\/blog\/wp-json\/wp\/v2\/tags?post=929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}