在Heroku上将hobby-dev升级到hobby-basic [英] Upgrade hobby-dev to hobby-basic on Heroku

查看:203
本文介绍了在Heroku上将hobby-dev升级到hobby-basic的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍然为Heroku的计划所困扰.但是我知道数据库中大约有3M行,因此我需要从hobby-dev升级到hobby-basic.

I'm still getting my head wrapped around Heroku's plans. But I know I'm going to have around 3M rows in the db so I need to upgrade from hobby-dev to hobby-basic.

但是,我找不到有关此升级级别的任何文档或帮助.只有文档才能从Hobby转到Standard.

However, I can't find any documentation or help about this level of upgrade. Only docs to go from Hobby to Standard.

我需要创建一个新的PG加载项,然后清除我的爱好开发数据库吗?

Do I need to create a new PG Add-On and then wipe out my hobby-dev db?

推荐答案

此答案假定您使用的是Heroku CLI.命令中的任何"YOUR_APP_NAME"实例都应替换为正在使用的Heroku App的应用程序名称.

This answer assumes that you're using Heroku CLI. Any instance of "YOUR_APP_NAME" in a command should be replaced by the application name of the Heroku App you're working with.

1.设置新的hobby-basic数据库:

1. Provision a new hobby-basic database:

heroku addons:create heroku-postgresql:hobby-basic -a YOUR_APP_NAME

这将为包含颜色的新数据库输出名称.您稍后将需要参考此内容.例如:

This will output a name for the new database containing a color. You will need to refer to this later. For example:

HEROKU_POSTGRESQL_PINK_URL

2. (可选)将数据库置于维护模式,以确保在复制数据库时不会将任何数据添加到数据库中.

heroku maintenance:on --app YOUR_APP_NAME

3.将现有的hobby-dev数据库复制到hobby-basic数据库

3. Copy the existing hobby-dev db to the hobby-basic db

heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_PINK --app YOUR_APP_NAME

Heroku现在将打印以下消息.

Heroku will now print the following message.

heroku pg:copy DATABASE_URL HEROKU_POSTGRESQL_PINK --app YOUR_APP_NAME

!    WARNING: Destructive Action
!    Transfering data from DATABASE_URL to HEROKU_POSTGRESQL_PINK
!    This command will affect the app: YOUR_APP_NAME
!    To proceed, type "YOUR_APP_NAME" or re-run this command with --confirm YOUR_APP_NAME

YOUR_APP_NAME

4.通过输入应用程序的实际名称来确认数据库传输

YOUR_APP_NAME

5.推广您的新数据库

heroku pg:promote HEROKU_POSTGRESQL_PINK --app YOUR_APP_NAME

应该从步骤1中获得的输出中复制要升级的数据库的基于颜色的名称.请勿复制并粘贴逐字上方的行,否则将无法正常工作.

The color-based name of the database you promote should be copied from the output you got up in step 1. Do not copy and paste the line above word for word, it will not work.

6.如果您之前将数据库置于维护模式,请关闭它.

heroku maintenance:off --app YOUR_APP_NAME

这篇关于在Heroku上将hobby-dev升级到hobby-basic的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆