# The \`$rake db:\*\` commands and initializing a Discourse instance

**URL:** <https://meta.discourse.org/t/the-rake-db-commands-and-initializing-a-discourse-instance/198938>\
**Category:** Self-hosting\
**Tags:** hosting\
**Created:** [August 2, 2021, 7:44pm UTC](https://meta.discourse.org/t/the-rake-db-commands-and-initializing-a-discourse-instance/198938 "2021-08-02T19:44:15Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jontrossbach](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jontrossbach/32/215843_2.png) [@jontrossbach](https://meta.discourse.org/u/jontrossbach)\
**Post date:** [August 2, 2021, 7:44pm UTC](https://meta.discourse.org/t/the-rake-db-commands-and-initializing-a-discourse-instance/198938/1 "2021-08-02T19:44:15Z")

</div>

First off, thank you to the devs for creating such a great app!

I am hoping I might be able to get something clarified that has me confused. I was under the impression that the proper way to use `$ rake db:*` commands in Rails 6 for initialization was by doing `$ rake db:prepare` but discourse won’t initialize properly if I do `$ rake db:prepare` by itself. And from the discussions on Meta/here; I see that prepare only seems to be used for initializing test data and maybe somewhere in the background tasks that are run.

Could someone please help me understand if `$ rake db:migrate` is the only command I need to initialize discourse’s database for db migrations or initializations and why this is the case?

---

_[View the full topic](https://meta.discourse.org/t/the-rake-db-commands-and-initializing-a-discourse-instance/198938)._
