title: How to use Python to export Visual FoxPro Database into other DB?
body: <p>I'm trying to extract all the data from a NetYield database (built on Visual FoxPro) - have a bunch of .dbf files and a .dbc file. </p>
  
  <p>I assume the .dbc file has the relationships and all the names properly, and want to try to extract this to ANY database (will be happy with CSV or Access or MySQL) to work with the data. </p>
  
  <p>Eventually, this will be ported over to a new ERP system (SAP Business One).</p>
  
  <p>I have tried using Software Solutions, but they are expensive and the Trials don't seem to have retained the relationships between the tables (but I could be wrong, and the full-price solutions would - unfortunately, don't have the ability to approve budget items on my own to buy it and test it out).</p>
  
  <p>Have tried some Python code from the thread: <a href="https://stackoverflow.com/questions/13994584/reading-dbf-files-with-pyodbc">Reading DBF files with pyodbc</a>
  But, it's a 'bit beyond my understanding (more of a JS / Java developer here)</p>
  
  <pre class="lang-py prettyprint-override"><code>import dbf
  from glob import glob
  
  dbf.Table()
  
  for dbf_file in glob(r'C:\users\Bijan\OneDrive\AAF\NetYield\070719_133749\*.dbf'):
      with dbf.Table(dbf_file) as table:
          dbf.export(table, dbf_file)
  </code></pre>
  
  <p>I'm expecting a perfect relational database as the output - but I will be happy with building those relationships myself, as long as I can get the data out of the current format into something more modern. </p>
  
  <p>Thank you</p>