title: The best way to export rails database data
body: <p>RAILS 5.1</p>
  
  <p>I have a RAILS application thats using PostgreSQL as database. I want to export/dump the RAILS database data from the RAILS perspective. So I'm independend from the database. Later then I want to use this export/dump file to load/import/seed the data back into the database. </p>
  
  <p>I have tried the following GEMs:</p>
  
  <ul>
  <li><p><strong>seed_dump</strong><br>
  It works, but it can't handle HABTM model relations. </p></li>
  <li><p><strong>yaml_db</strong> , 
  It works, but the yaml format is not the format understood by a <strong>rails db:seed</strong></p></li>
  </ul>