title: create table and clone one record from old table to new one
body: <p>The situation is the following:
  I have a table (PERSONS) with collection of records. it's structure: </p>
  
  <pre><code>id, 
  created, 
  modified, 
  number, 
  first_name, 
  … (up to 30 positions)
  </code></pre>
  
  <p>This is the ‘bank’ of employees. Well, and I have to prepare, yearly archive of this table (such a black box for not used data). It should be done in four steps:</p>
  
  <ol>
  <li>check if archive exists e.g. 2015_PERSONS</li>
  <li>If no, create table 2015_PERSONS</li>
  <li>copy single records from PERSONS table to 2015_PERSONS table</li>
  <li>delete this record from PERSONS table </li>
  </ol>
  
  <p>It isn’t difficult normal way but I try to do it without special entity for archive file, and I found some problems. First and fourth steps are easy for me but second and third not.
  Second step is the following (in the PERSONS controller):</p>
  
  <pre><code>$manager  = $this-&gt;getDoctrine()-&gt;getManager();
  $metadata = $manager-&gt;getClassMetadata(PERSONS::class);
  $metadata-&gt;setPrimaryTable(array('name' =&gt; ‘2015_PERSONS’));
  $schema = new SchemaTool($manager);
  $schema-&gt;createSchema(array($metadata));
  </code></pre>
  
  <p>and the archive table is created but with one difference. In the first table “id” field is “bigint 12” autoincrement (MySQL) but in the second “id” is “int 11” autoincrenent and I don’t know why. The rest of fields (int, text, varchar) are the same. Definition in the PERSONS entity is the following:</p>
  
  <pre><code>/**
   * @ORM\Id
   * @ORM\Column(type="integer")
   * @ORM\GeneratedValue(strategy="AUTO")
   */
   protected $id;
  </code></pre>
  
  <p>But the root problem is with third step, because I can’t find the way to place data. I try to do it the following ways:</p>
  
  <pre><code>$data = $this-&gt;getRepo('PERSONS')-&gt;findOneBy(1);
  $second = clone $data;
  $second-&gt;setId(null);
  $second-&gt;save();
  </code></pre>
  
  <p>OR</p>
  
  <pre><code>$second = new Second();
  $second-&gt;fromArray($data-&gt;toArray());
  $second-&gt;save();
  </code></pre>
  
  <p>And don’t know how to find handle for 2015_PERSONS table to save prepared data copy. Be so kind as to prompt me.</p>