How to wipe Heroku Redis?
Solution 1
You can do this with redis-cli.
RedisToGo gives you a url in the form:
redis://redistogo:[email protected]:9402
So this command will empty your db:
redis-cli -h catfish.redistogo.com -p 9402 -a d20739cffb0c0a6fff719acc2728c236 flushall
Solution 2
You can install the heroku-redis-cli plugin
Installation
Requirements:
The heroku gem —
gem install heroku
A local installation of redis (or at least the redis-cli utility) —
apt-get install redis-server
To install:
heroku plugins:install https://github.com/rapportive-oss/heroku-redis-cli.git
Usage
heroku redis:info
— get run-time statistics from your redis.heroku redis:monitor
— monitor commands being sent to your redis in real time.heroku redis:cli
— execute custom commands against redis.
Then you could simply do:
$ heroku redis:cli
$ flushall
Steps taken from readme file on the github repo: https://github.com/rapportive-oss/heroku-redis-cli
Solution 3
To wipe your redis on heroku there are a couple of ways. One of the simplest is probably connecting to the heroku console and clearing it from there. Commands are (for cedar stack):
heroku run console
REDIS.flushall
And that's it :-)
Solution 4
You can do this with the heroku console:
$ heroku redis:cli -a my_app --confirm my_app
$ FLUSHALL
Source: https://menubar.io/heroku-redis-flushall
Solution 5
You can destroy and recreate the entire Redis datastore for your app by doing:
heroku addons:remove redistogo
heroku addons:add redistogo
Comments
-
kidcapital almost 2 years
I have some information stored in my RedisToGo instance in Heroku and I want to wipe it so the Redis store is clean. Any idea how to do this?
-
kidcapital over 12 yearsIs there a better way than dropping and re-adding the whole instance?
-
user7740901 over 12 yearsThat's the easiest way. If you are using the environment variable then this should be a quick and easy change.
-
Neil Middleton over 12 yearsIt depends on what you're using to be honest, if it's something like Rails you can run it via the Rails console (
heroku run console
) - however, it's very dependant on what tools you're using. -
esbanarango about 10 yearsIt is not an Heroku command but an heroku-redis-cli plugin command.
-
Lal Krishna almost 10 yearsIt hasn't been updated for over 2 years and doesn't work
-
Dom Barker over 9 yearsonly if you are running a ruby app
-
Admin about 9 yearsThis gives me
(error) NOAUTH Authentication required.
. What is that about? -
amlutz160 over 8 yearsthis was definitely an easier approach. worked for me.
-
ty. over 8 years@torazaburo That error occurs when you've entered bad credentials.
-
Jesse Farmer over 5 yearsThis no longer works. You get a NOAUTH error. There may be a missing step, but the steps above will just yield an error.
-
ty. over 5 years@JesseFarmer I was just able to run this command successfully. Received "OK" response. You might want to double check your credentials.
-
AndreiMotinga over 5 years@ty, it responds with OK, but it seems like it doesn't actually clear it. So far I wasn't able to find a way to clear rediscloud redis without accessing rails console.
-
nmu about 4 years@Keyul just tried it and it seems to still be working.
-
Radon Rosborough about 4 yearsThe plugin fails to install.
-
Tallboy about 2 yearsFor anyone reading this answer, you can simply do
redis-cli -u redis://...
with the URL