【问题标题】:Moving dev site to production on new account AWS在新账户 AWS 上将开发站点迁移到生产环境
【发布时间】:2016-01-26 00:38:38
【问题描述】:

我现在正在移动和测试实际域名上的开发站点,我只是想检查一下我是否遗漏了什么并获得一些建议。

它是从在 m1.medium 实例上运行的 Turnkey Linux 安装的 Magento 1.8.1。

我所做的(到目前为止)是创建开发实例的图像,创建一个新帐户并将其复制到那里。然后我创建了一个弹性 IP 并将其与新实例相关联。接下来我将生产域的A名称记录指向弹性IP。

现在,如果我转到生产域,我会被重定向到开发域。这是有原因的吗?

理想情况下,我希望有两个实例,一个是开发,一个是关闭的,除非需要,当然还有一个 24/7 全天候运行的生产。但是,如果我关闭开发域,它也会停止另一个。

我有一种感觉,这只是因为我需要更改 Magento 数据库/后端中的 dev 域的实例,但是我想得到一个更有见识的答案,因为我不想破坏任何一个实例。

另外,我可能应该提到开发域是一个子域,即 shop.mysite.com,而实时域是正常的,即 mysite.com。不完全确定这是否相关,但认为值得一提。

提前感谢您的帮助。

【问题讨论】:

    标签: magento amazon-web-services amazon-ec2 hosting


    【解决方案1】:

    新实例上的 URL 被重定向到旧 URL 的原因是,在 magento 数据库的 core_config_data 表中,web/unsecure/base_urlweb/secure/base_url 路径指向旧 URL。

    因此,如果您使用的是 mysql,您可以按如下方式查询您的数据库:

    mysql> use magento;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Database changed
    mysql> select * from core_config_data;
    +-----------+---------+----------+-------------------------------+-------------------------------------+
    | config_id | scope   | scope_id | path                          | value                               |
    +-----------+---------+----------+-------------------------------+-------------------------------------+
    |         1 | default |        0 | web/seo/use_rewrites          | 1                                    |
    |         2 | default |        0 | admin/dashboard/enable_charts | 0                                   |
    |         3 | default |        0 | web/unsecure/base_url         | http://magento.myolddomain.com/         |
    |         4 | default |        0 | web/secure/use_in_frontend    | 1                                   |
    |         5 | default |        0 | web/secure/base_url           | https://magento.myolddomain.com/        |
    |         6 | default |        0 | web/secure/use_in_adminhtml   | 1                                   |
    |         7 | default |        0 | general/locale/code           | en_US                               |
    |         8 | default |        0 | general/locale/timezone       | Europe/London                       |
    |         9 | default |        0 | currency/options/base         | USD                                 |
    |        10 | default |        0 | currency/options/default      | USD                                 |
    |        11 | default |        0 | currency/options/allow        | USD                                 |
    |        12 | default |        0 | general/region/display_all    | 1                                   |
    |        13 | default |        0 | general/region/state_required | AT,CA,CH,DE,EE,ES,FI,FR,LT,LV,RO,US |
    |        14 | default |        0 | catalog/category/root_id      | 2                                   |
    +-----------+---------+----------+-------------------------------+-------------------------------------+
    14 rows in set (0.00 sec)
    

    您可以按如下方式进行更改:

    mysql> update core_config_data set value='http://magento.mynewdomain.com' where path='web/unsecure/base_url';
    mysql> update core_config_data set value='https://magento.mynewdomain.com' where path='web/secure/base_url';
    

    【讨论】:

    • 嘿,这听起来很完美,但我担心的是我希望这两个网站都能正常工作。如果我更改 core_config_data 中的 URL,这不会允许开发站点转移到生产环境,但反过来会杀死开发站点?我问的原因是因为我希望将来能够在开发站点上测试更新更改等。对此有什么想法吗?编辑:顺便感谢您的帮助!
    • 我的错误,出于某种原因,我认为数据库/服务器是一个而不是两个相同的副本。这非常有效!感谢所有帮助:)
    猜你喜欢
    • 2020-05-14
    • 2012-03-13
    • 1970-01-01
    • 2016-02-17
    • 1970-01-01
    • 1970-01-01
    • 2011-12-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多