<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>selfoss support forum - Migrating from sqlite to mysql</title>
<link>https://forum.selfoss.aditu.de/</link>
<description>selfoss support forum</description>
<language>en</language>
<item>
<title>Migrating from sqlite to mysql (reply)</title>
<content:encoded><![CDATA[<p>Hi, thanks for this, I'm going to try this.<br />
Does your UPDATE fix the encoding problem?</p>
<p>Cheers<br />
Nicolas</p>
]]></content:encoded>
<link>https://forum.selfoss.aditu.de/index.php?id=633</link>
<guid>https://forum.selfoss.aditu.de/index.php?id=633</guid>
<pubDate>Tue, 03 Sep 2013 05:52:15 +0000</pubDate>
<dc:creator>nico13</dc:creator>
</item>
<item>
<title>Migrating from sqlite to mysql (reply)</title>
<content:encoded><![CDATA[<p>Just found an issue:</p>
<p>During the migration the characters in some fields are not encoded correctly. I had to run a &quot;UPDATE sources SET spout = 'spouts\\rss\\feed' WHERE spout = 'spouts\rss\feed'&quot; on the database but I only have RSS sources.</p>
]]></content:encoded>
<link>https://forum.selfoss.aditu.de/index.php?id=632</link>
<guid>https://forum.selfoss.aditu.de/index.php?id=632</guid>
<pubDate>Mon, 02 Sep 2013 12:56:31 +0000</pubDate>
<dc:creator>Keksdose</dc:creator>
</item>
<item>
<title>Migrating from sqlite to mysql (reply)</title>
<content:encoded><![CDATA[<p>Hi,</p>
<p>I had the same problem and made a quick and dirty solution for this. Just paste it in a file (let's say migrate.php), change the settings for sqlite and mysql and call it from the console. (php -f migrate.php)</p>
<p>&lt;?php<br />
    $sqlite_db = 'data/sqlite/selfoss.db'; // enter path to selfoss db<br />
    $mysql_hostname = '&lt;CHANGEME&gt;'; // enter hostname of mysql server<br />
    $mysql_database = '&lt;CHANGEME&gt;'; // enter database name<br />
    $mysql_username = '&lt;CHANGEME&gt;'; // enter username<br />
    $mysql_password = '&lt;CHANGEME&gt;'; // enter password</p>
<p>    $dbs = new SQLite3($sqlite_db);<br />
    $dbm = new mysqli($mysql_hostname, $mysql_username, $mysql_password, $mysql_database);</p>
<p>    $count_items = 0;<br />
    $count_sources = 0;<br />
    $count_tags = 0;</p>
<p>    $dbs_result = $dbs-&gt;query('SELECT * FROM items');</p>
<p>    while($dbs_row = $dbs_result-&gt;fetchArray()) {<br />
        $dbm-&gt;query(sprintf(&quot;INSERT INTO items SET id = '%s', datetime = '%s', title = '%s', content = '%s', thumbnail = '%s', icon = '%s', unread = '%s', starred = '%s', source = '%s', uid = '%s', link = '%s'&quot;, $dbs_row['id'], $dbs_row['datetime'], $dbs_row['title'], $dbs_row['content'], $dbs_row['thumbnail'], $dbs_row['icon'], $dbs_row['unread'], $dbs_row['starred'], $dbs_row['source'], $dbs_row['uid'], $dbs_row['link']));<br />
        echo(&quot;Items: &quot;.++$count_items.&quot;\r&quot;);<br />
    }<br />
    echo(&quot;\n&quot;);</p>
<p>    $dbs_result = $dbs-&gt;query('SELECT * FROM sources');</p>
<p>    while($dbs_row = $dbs_result-&gt;fetchArray()) {<br />
        $dbm-&gt;query(sprintf(&quot;INSERT INTO sources SET id = '%s', title = '%s', tags = '%s', spout = '%s', params = '%s', error = '%s', lastupdate = '%s'&quot;, $dbs_row['id'], $dbs_row['title'], $dbs_row['tags'], $dbs_row['spout'], $dbs_row['params'], $dbs_row['error'], $dbs_row['lastupdate']));<br />
        echo(&quot;Sources: &quot;.++$count_sources.&quot;\r&quot;);<br />
    }<br />
    echo(&quot;\n&quot;);</p>
<p>    $dbs_result = $dbs-&gt;query('SELECT * FROM tags');</p>
<p>    while($dbs_row = $dbs_result-&gt;fetchArray()) {<br />
        $dbm-&gt;query(sprintf(&quot;INSERT INTO tags SET tag = '%s', color = '%s'&quot;, $dbs_row['tag'], $dbs_row['color']));<br />
        echo(&quot;Tags: &quot;.++$count_tags.&quot;\r&quot;);<br />
    }<br />
    echo(&quot;\n&quot;);</p>
]]></content:encoded>
<link>https://forum.selfoss.aditu.de/index.php?id=631</link>
<guid>https://forum.selfoss.aditu.de/index.php?id=631</guid>
<pubDate>Mon, 02 Sep 2013 10:38:43 +0000</pubDate>
<dc:creator>Keksdose</dc:creator>
</item>
<item>
<title>so... (reply)</title>
<content:encoded><![CDATA[<p>no one??</p>
]]></content:encoded>
<link>https://forum.selfoss.aditu.de/index.php?id=364</link>
<guid>https://forum.selfoss.aditu.de/index.php?id=364</guid>
<pubDate>Fri, 19 Apr 2013 14:47:31 +0000</pubDate>
<dc:creator>nico13</dc:creator>
</item>
<item>
<title>Migrating from sqlite to mysql</title>
<content:encoded><![CDATA[<p>Hello</p>
<p>I would like to migrate from sqlite to mysql.<br />
I noticed if I just modify the config files it seems I have to reimport my rss feeds. </p>
<p>Since I started using selfoss I imported an opml file from google reader and since then I added by hand several feeds.<br />
How can I save / export a new opml taking into account all feeds manually added?</p>
<p>(or is it a simpler way to migrate to mysql??)</p>
<p>thanks<br />
Nicolas</p>
]]></content:encoded>
<link>https://forum.selfoss.aditu.de/index.php?id=360</link>
<guid>https://forum.selfoss.aditu.de/index.php?id=360</guid>
<pubDate>Thu, 18 Apr 2013 14:32:03 +0000</pubDate>
<dc:creator>nico13</dc:creator>
</item>
</channel>
</rss>
