<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GIS and Web Tricks &#187; multilingual blogging</title>
	<atom:link href="http://www.bernawebdesign.ch/byteblog/tagged/multilingual-blogging/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bernawebdesign.ch/byteblog</link>
	<description>Thougts and tricks on GIS, web development and FOSS</description>
	<lastBuildDate>Tue, 23 Mar 2010 17:11:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>migrating wordpress from gengo to wpml</title>
		<link>http://www.bernawebdesign.ch/byteblog/2009/08/15/migrating-wordpress-from-gengo-to-wpml/</link>
		<comments>http://www.bernawebdesign.ch/byteblog/2009/08/15/migrating-wordpress-from-gengo-to-wpml/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 13:13:59 +0000</pubDate>
		<dc:creator>marco</dc:creator>
				<category><![CDATA[web 2.0]]></category>
		<category><![CDATA[gengo]]></category>
		<category><![CDATA[multilingual blogging]]></category>
		<category><![CDATA[wpml]]></category>

		<guid isPermaLink="false">http://www.bernawebdesign.ch/byteblog/?p=94</guid>
		<description><![CDATA[A client of mine used to have a multilingual blog using the Gengo plugin, which I consider by now unfortunatly dead. Fortunately, the guys at http://www.wpml.org did a great job creating a new plugin that works like a charm. I did the migration from one to the other and I had no troubles (beside figuring [...]]]></description>
			<content:encoded><![CDATA[<p>A client of mine used to have a multilingual blog using the Gengo plugin, which I consider by now unfortunatly dead. Fortunately, the guys at http://www.wpml.org did a great job creating a new plugin that works like a charm.<span id="more-94"></span></p>
<p>I did the migration from one to the other and I had no troubles (beside figuring out how to map gengo&#8217;s model to wpml). Further down  are two SQL statements to check and update the posts language in wpml.</p>
<p>IMPORTANT: first disable gengo, then install wpml, then choose the default language and create the languages you had in geng. All your post will now be in the default language. you can check this with this SQL statement (for example using phpMyAdmin)</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> post<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`ID`</span><span style="color: #66cc66;">,</span> post<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`post_title`</span><span style="color: #66cc66;">,</span> wpml<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`language_code`</span> <span style="color: #993333; font-weight: bold;">AS</span> wpml_language<span style="color: #66cc66;">,</span> gengoLang<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`code`</span> <span style="color: #993333; font-weight: bold;">AS</span> gengo_language
<span style="color: #993333; font-weight: bold;">FROM</span> <span style="color: #ff0000;">`wp_posts`</span> post
<span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> <span style="color: #ff0000;">`wp_icl_translations`</span> wpml <span style="color: #993333; font-weight: bold;">ON</span> wpml<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`element_id`</span> <span style="color: #66cc66;">=</span> post<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`ID`</span>
<span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> <span style="color: #ff0000;">`wp_post2lang`</span> gengo <span style="color: #993333; font-weight: bold;">ON</span> gengo<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`post_id`</span> <span style="color: #66cc66;">=</span> post<span style="color: #66cc66;">.</span>ID
<span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> <span style="color: #ff0000;">`wp_languages`</span> gengoLang <span style="color: #993333; font-weight: bold;">ON</span> gengoLang<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`language_id`</span> <span style="color: #66cc66;">=</span> gengo<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`language_id`</span>
<span style="color: #993333; font-weight: bold;">WHERE</span> wpml<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`element_type`</span> <span style="color: #66cc66;">=</span><span style="color: #ff0000;">'post'</span>
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> post<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`ID`</span>  <span style="color: #993333; font-weight: bold;">DESC</span>;</pre></div></div>

<p>Then you can update the post language with the following statement:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">UPDATE</span> <span style="color: #ff0000;">`wp_icl_translations`</span> wpml
<span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> <span style="color: #ff0000;">`wp_posts`</span> post <span style="color: #993333; font-weight: bold;">ON</span> wpml<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`element_id`</span> <span style="color: #66cc66;">=</span> post<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`ID`</span>
<span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> <span style="color: #ff0000;">`wp_post2lang`</span> gengo <span style="color: #993333; font-weight: bold;">ON</span> gengo<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`post_id`</span> <span style="color: #66cc66;">=</span> post<span style="color: #66cc66;">.</span>ID
<span style="color: #993333; font-weight: bold;">LEFT</span> <span style="color: #993333; font-weight: bold;">JOIN</span> <span style="color: #ff0000;">`wp_languages`</span> gengoLang <span style="color: #993333; font-weight: bold;">ON</span> gengoLang<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`language_id`</span> <span style="color: #66cc66;">=</span> gengo<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`language_id`</span>
<span style="color: #993333; font-weight: bold;">SET</span> wpml<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`language_code`</span> <span style="color: #66cc66;">=</span> gengoLang<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`code`</span>
<span style="color: #993333; font-weight: bold;">WHERE</span> wpml<span style="color: #66cc66;">.</span><span style="color: #ff0000;">`element_type`</span> <span style="color: #66cc66;">=</span><span style="color: #ff0000;">'post'</span></pre></div></div>

<p>This will update your POSTS only, no category or tags yet. I might look at those as well and I&#8217;ll get in touch with wpml to see if they can use my snippets to get out a sort of import tool.</p>
<p>cheers Marco</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bernawebdesign.ch/byteblog/2009/08/15/migrating-wordpress-from-gengo-to-wpml/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
