How To Reset Your Mastodon Database
Hey, up to something wild that makes you wanna erase your entire database?
Written on November 02, 2023 · 1 min read
I'm not sure what's going on with your Mastodon instance, but if you're aiming to start fresh with an empty Mastodon database, I've got a way for you to do it!
Heads up: This move’s gonna wipe your entire Mastodon database clean. All users, toots, and pretty much everything will vanish. Do it at your own risk.
-
Login to your Mastodon instance server using SSH.
-
Change user to mastodon (if you're not logged in as
mastodon
user) by running:
su - mastodon
- Change the directory to your Mastodon directory:
cd ~/live
- Run this irreversible and destructive command:
DISABLE_DATABASE_ENVIRONMENT_CHECK=1 RAILS_ENV=production bundle exec rake mastodon:setup
-
Answer all the questions
-
Done! You can now login to your fresh Mastodon instance with the new credentials.
This note is written by Diky Hadna — Software Engineer & Digital Nomad Mentor. Read my story and get in touch with me!