go to heroku.com the site you are upgrading
-
add the new database - we chose 'CRANE' for 50$ / month
heroku addons:add heroku-postgresql:crane -
in console
heroku pg:wait --remote staging
| run the redis server | |
| 1. in the command line | |
| redis-server | |
| 2. start the rails server | |
| rs | |
| 3. start the resque rake task | |
| QUEUE=* rake resque:work |
| heroku = PlatformAPI.connect_oauth('f04asdfbd-18e5-4486-b4df-873asdfa') | |
| heroku.app.info('dbappdev') | |
| heroku.formation.list('dbappdev') | |
| heroku.dyno.list('dbappdev') | |
| heroku.dyno.info('dbappdev', dyno_id) |
| http://www.rubydoc.info/gems/resque/frames | |
| Resque.info | |
| {:pending=>0, :processed=>157473, :queues=>7, :workers=>21, :working=>0, :failed=>0, :servers=>["redis://barb.redistogo.com:9497/0"], :environment=>"production"} | |
| Resque.workers | |
| returns an array of workers available | |
| Resque.workers.each {|w| w.prune_dead_workers } | |
| kills dead workers | |
| w = Resque.workers[0] |
| c = ActiveRecord::Base.connection | |
| c.tables.collect do |t| | |
| columns = c.columns(t).collect(&:name).select {|x| x.ends_with?("_id" || x.ends_with("_type"))} | |
| indexed_columns = c.indexes(t).collect(&:columns).flatten.uniq | |
| unindexed = columns - indexed_columns | |
| unless unindexed.empty? | |
| puts "#{t}: #{unindexed.join(", ")}" | |
| end | |
| end |
| module RetryOnTermJob | |
| def around_perform_retry_on_term(*args) | |
| begin | |
| yield *args | |
| rescue Exception => e | |
| if e.message =~ /SIGTERM/ | |
| # when a worker `extend`s this class, self is that worker class | |
| Resque.enqueue(self, *args) | |
| else | |
| raise |
go to heroku.com the site you are upgrading
add the new database - we chose 'CRANE' for 50$ / month
heroku addons:add heroku-postgresql:crane
in console
heroku pg:wait --remote staging
| git reset --hard 10123974102937840192374 | |
| this moves the pointer to that commit. This is what you want most of the time | |
| git reset --soft 0238947293842937429384723 | |
| this moves the pointer and via an index that you commit , very strange. | |
| git stash | |
| stash the last commit | |
| git stash apply | |
| applies the last stash | |
| git stash apply stash@{2} | |
| if you want one of the older ones | |
| git stash drop with the name of the stash to remove: |
updated in https://gist.github.com/joncode/46ca26a497ee7b9f477a
####Step 1 $ openssl genrsa -des3 -out host.key 2048 you will be asked for a passphrase - very important to store this ####Step 2