# Import predefined data to database using YAML

**URL:** <https://www.ruby-forum.com/t/import-predefined-data-to-database-using-yaml/143443>\
**Category:** Rails\
**Created:** [July 18, 2008, 5:25pm UTC](https://www.ruby-forum.com/t/import-predefined-data-to-database-using-yaml/143443 "2008-07-18T17:25:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sven\_Clement](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@Sven\_Clement](https://www.ruby-forum.com/u/Sven_Clement)\
**Post date:** [July 18, 2008, 5:25pm UTC](https://www.ruby-forum.com/t/import-predefined-data-to-database-using-yaml/143443/1 "2008-07-18T17:25:28Z")

</div>

Hello,  
I would need a way to import some data which I already have in the YAML  
format to be written to the database. This is used especially to preload  
the  
database with some standard data like postal codes and different  
attributes  
for my objects.

How may I proceed to import the data to the DB? I also have some of the  
data  
available as XML so if it would be easier to do it with XML please  
advise me  
to do so!

Thank you for your help in advance!

Sven Clement
