Can I export a Sqlite db using RedBean PHP ORM and Import to MySQL? : <p>I have a simple web app that I've been building using <code>redbean</code> PHP which has a really simple structure with three bean types:</p>

<p>areas
buildings
persons</p>

<p>All relationships are exclusive 1:Many. So, a <code>Person</code> belongs to only 1 <code>Building</code>, and a <code>Building</code> belongs to 1 <code>Area</code>. </p>

<pre><code>Area
  BuildingList
    PersonList
</code></pre>

<p>Currently, I have been developing it using <code>Sqlite3</code> for ease of development, but I want to move the data to <code>mySQL</code>. I have a lot of data that I've already added.</p>

<p>Is there an easy way to use RedBean to Export ALL beans to the new MySql Database?</p>

<p>I know I can search for a <code>sqlite</code> -> <code>MySQL</code>/<code>MariaDB</code> converter, but I also potentially want to be able to use this in reverse to make migrating the site super easy to move/backup/change DBs.</p>

<p>What I've tried below:</p>

<pre><code>R::setup('sqlite:/' . __DIR__ . '/data/database.db'); 
R::addDatabase('mysql', $MySqlConn );

$old_datas = R::findAll( 'area' );
R::selectDatabase( 'mysql' );

foreach ($old_datas as $bean) {
    $new_area = R::dispense('area');
    $new_area-&gt;importFrom( $bean );
    $id = R::store( $new_area );
    var_dump( $new_area ); // shows new data
}

var_dump( R::findAll( 'area' ) ); // returns empty array
</code></pre>
