Create seed file from data already in the database April 7, 2023 by Tarik There is a gem called seed_dump, which will do exactly what you want: https://github.com/rroblak/seed_dump http://rubygems.org/gems/seed_dump