Database backup

Hello, I developed a RoR application where users can create personal
accounts with several informations. Those informations are divided in
various tables of the database.
The thing is I want to create a function so that they can backup all
the information corresponding to their account. The idea is to add a
button in their profile page let's say "backup my account" that would
trigger the function, create the database file with their data and
download the file so that if anything occurs on the database they
would be able to upload the file and get their account back without
any problem.

I've been looking on the internet and found a few things, for example
the "rake db:backup:write" (that is giving me a "no such file to load
-- spec" actualy). But the thing is I don't want to save all the
database but only the part that correspond to the account of the user
that is using the function. I could create a function that would get
all the account information and generate an sql or csv file by my own
but I though maybe something already exists.

Any idea?