# Db:backup and db:restore tasks

**URL:** <https://discuss.rubyonrails.org/t/db-backup-and-db-restore-tasks/81635>\
**Category:** rubyonrails-talk\
**Created:** [October 27, 2022, 2:28pm UTC](https://discuss.rubyonrails.org/t/db-backup-and-db-restore-tasks/81635 "2022-10-27T14:28:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![merlin2049er](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/merlin2049er/32/952_2.png) [@merlin2049er](https://discuss.rubyonrails.org/u/merlin2049er)\
**Post date:** [October 27, 2022, 2:28pm UTC](https://discuss.rubyonrails.org/t/db-backup-and-db-restore-tasks/81635/1 "2022-10-27T14:28:01Z")

</div>

I’ve created 2 tasks, backup and restore. They seem to be perfectly working fine running from the command line.  
The issue is, they want buttons on a form that run these tasks, (which I did). But, when the rake restore task is run from within the application the database doesn’t get dropped (because it’s active) and it doesn’t fully restore the data that was missing. I don’t know how to proceed.

---

<div class="post-metadata">

**Author:** ![merlin2049er](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/merlin2049er/32/952_2.png) [@merlin2049er](https://discuss.rubyonrails.org/u/merlin2049er)\
**Post date:** [October 27, 2022, 2:53pm UTC](https://discuss.rubyonrails.org/t/db-backup-and-db-restore-tasks/81635/2 "2022-10-27T14:53:30Z")

</div>

nevermind, db:reset instead of db:drop worked!
