2013-03-19 103 views
8

對不起,如果這是一個愚蠢的問題,我是Heroku新主機,並希望StackOverflow的專家之一可以幫助我。升級Heroku Postgres DB計劃

我申請的是一個基本的免費的Postgres數據庫爲我的Heroku應用程序,但最近我已經打了10K行限制,並想升級到$ 9 /月計劃。但是,我完全不知道該怎麼做。這是一個相對簡單的過程嗎?我不敢問這個問題,我感到很沮喪。

當我登錄到heroku並點擊我的應用程序時,我看到了我的應用程序的附件列表。當我點擊Postgres加載項時,它將我帶到一個單獨的網頁,但我沒有看到任何升級我的DB計劃的選項。

任何提示?

謝謝!

回答

8

目前正是這種做對Heroku的網站上的文檔:Upgrade Heroku postgres with pgbackups

總之,步驟如下:

  • 建立一個新的新的基本數據庫
  • 阻止更新(組維持性的模式)
  • 捕捉您的備份
  • 備份還原到新數據庫
  • 宣傳您的新數據庫
  • 使您的應用程序處於活動狀態

這些也是相同的步驟,如果你決定去生產計劃跟隨。

+1

謝謝!現在我覺得在谷歌吸吮愚蠢。 – 2013-03-19 16:22:10

1

這是一個簡單的過程。他們有一篇文章就是爲了這個here

17

升級後的Heroku DB葛蕾:

1. heroku config 
     It will show current database URL 
     HEROKU_POSTGRESQL_COPPER_URL: postgres://xxxddxxdx:[email protected]:5432/xdfdsxdxxxx 
     HEROKU_POSTGRESQL_SILVER_URL: postgres://fasdfsad:[email protected]:5432/sdfasdfdasfds 
     //Default database set 
     DATABASE_URL: postgres://fasdfsad:[email protected]:5432/dsfsdf 

//從命令添加新的數據庫,但我會在r命令服務器資源節去,然後單擊編輯附加組件,添加的pgsql和更改免費飛機您所需的計劃。

2. heroku addons:create heroku-postgresql:hobby-basic 

//Prevent new database updates 
3. heroku maintenance:on 
//Also off worker type dyno 
heroku ps:scale worker=0 

複製當前分貝到新的數據庫

4. heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_COPPER_URL --app prod-test 
heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_COPPER_URL --app prod-test 
    Note: 
    DATABASE_URL = It is config veriable which point default current db 
    HEROKU_POSTGRESQL_COPPER_URL = This is config variable for which db I just created 
    prod-test = It is my APP name 

5. Promote new database (Make new db as default db) 
    heroku pg:promote HEROKU_POSTGRESQL_COPPER_URL 

6. Re-enable worker dyno 
    heroku ps:scale worker=1 
    heroku maintenance:off 

7. remove old database 
heroku addons:remove HEROKU_POSTGRESQL_SILVER_URL