# Purging user data from dev install

**URL:** <https://meta.discourse.org/t/purging-user-data-from-dev-install/51827>\
**Category:** Development\
**Created:** [October 21, 2016, 2:43am UTC](https://meta.discourse.org/t/purging-user-data-from-dev-install/51827 "2016-10-21T02:43:01Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [October 22, 2016, 11:34pm UTC](https://meta.discourse.org/t/purging-user-data-from-dev-install/51827/4 "2016-10-22T23:34:48Z")

</div>

Here’s what I do on my development box, though making a backup of a fresh database and restoring from the web interface is a little faster, I think.

```bash
#!/usr/bin/env bash
if [! -f discourse.sublime-project]
then
    echo "Dude. There's no Discourse here."
    exit
else
    echo Killing any running rubies. . .
    killall ruby
    RAILS_ENV=development
    export RAILS_ENV
    sleep 5 # make sure they all quit
    RAILS_ENV=development bundle exec rake db:drop db:create db:migrate

    cat <<EOF | bundle exec rake admin:create
pfaffman@gmail.com
1secretpassword!
1secretpassword!

EOF
    echo Flushing Redis
    redis-cli flushall
    echo Done.
fi

```

---

_[View the full topic](https://meta.discourse.org/t/purging-user-data-from-dev-install/51827)._
