直到
logical followers in 9.4,你必须转储和恢复(由于Craig所描述的原因).您可以使用pgbackups进行简化:transfer.直接传输比转储和还原更快,但是知道您不会有快照来保存.
下面的脚本基本上是Heroku的Using PG Backups to Upgrade Heroku Postgres Databases
,修改为pgbackups:transfer.(如果有多个实例,例如分段服务器,请在每个Heroku行中添加“-a”或“–remote”来指定哪个服务器.)
# get the pgbackups plugin heroku plugins:install git://github.com/heroku/heroku-pg-extras.git # provision new db heroku addons:add heroku-postgresql:crane --version=9.2 # wait for it to come online,make note of new color heroku pg:wait # prevent new data from arriving during dump heroku ps:scale worker=0 web=0 heroku maintenance:on # copy over the DB. could take a while. heroku pgbackups:transfer OLDCOLOR NEWCOLOR # promote new database as default for DATABASE_URL heroku pg:promote NEWCOLOR # start everything back up and test heroku ps:scale worker=N web=N heroku maintenance:off heroku open # remove old database heroku addons:remove HEROKU_POSTGREsql_OLDCOLOR
请注意,如果您比较它们之间的数据大小,则新数据可能会因为9.2中的效率而小得多. (我的9.2是9.1的约70%)