适用于私有云的 Edge v4.18.01
开发者服务门户 4.18.01 版不支持更新旧版 基于 tar 版本的门户。您只能直接更新基于 RPM 的门户版本 至 4.18.01。
不过,您可以将基于 tar 的门户版本转换为基于 4.18.01 RPM 的 打开该门户在此过程中,您需要将现有门户的 MySQL/MariaDB Postgres 数据库。转换后,您的门户仍为基于 RPM 的门户。
您可以将许多以前版本的基于 tar 的门户迁移到基于 RPM 的门户, 包括版本 4.16.09 和 4.17.01,而不仅仅是 4.17.05。唯一的要求是 该门户正在运行 Drupal 7 或更高版本。如需查看您的 Drupal 版本,请选择报告 >Drupal 菜单中的状态报告。Drupal 版本显示在第一行中 输出内容。
从基于 tar 的门户迁移到基于 RPM 的门户的概要步骤 分别是:
- 在基于 RPM 的 4.18.01 版本上 新节点。
- 在基于 RPM 的门户上创建一个新的 Postgres 数据库。
- 从基于 tar 的门户迁移门户数据库。
- 从基于 tar 的门户将所有配件文件复制到基于 RPM 的 。
- 更新 DNS 条目以指向基于 RPM 的新门户。
 
 请注意,基于 RPM 的门户版本默认使用端口 8079,而基于 tar 的门户版本 使用端口 80确保您在 DNS 条目中使用了正确的端口号。如需了解相关信息,请参阅设置门户使用的 HTTP 端口。 另一个端口上的问题
新的默认安装目录位于 转化
更新现在使用 Nginx/Postgres 的安装后,根目录已更改 发件人:
/opt/apigee/apigee-drupal
to:
/opt/apigee/apigee-drupal/wwwroot
门户转换流程
若要将门户转换为基于 RPM 的安装,请执行以下操作:
- 在其他节点上安装基于 RPM 的 4.18.01 版开发者服务门户 从基于 tar 的门户启动
- 
      在基于 RPM 的门户上,创建一个新的 Postgres 数据库。稍后,您需要
      将数据库从基于 tar 的门户迁移到此新数据库:
      <ph type="x-smartling-placeholder">- </ph>
        
- 登录 psql:
 >psql -h localhost -p 5432 -U apigee
 
 输入门户配置中的 PG_PWD 属性所定义的 Postgres 密码 文件。
- 创建新的 Postgred 数据库:
 # 创建数据库 newportaldb;
- 退出 psql:
 # \q
 
- 登录 psql:
- 
      在基于 tar 的门户上,移除不再使用的旧模块: 
 >cd /var/www/html
 >drush sql-query --db-prefix "从 {system} 中删除,其中 name = 'apigee_account'且 type = 'module';"
 >drush sql-query --db-prefix "从 {system} 中删除,其中 name = 'apigee_checklist' AND type = 'module';"
 >drush sql-query --db-prefix "从 {system} 中删除,其中 name = 'apigee_sso_ui'且 type = 'module';"
- 
      在基于 tar 的门户上,安装并配置 Migrator Drupal 模块: - cd /tmp
- wget https://ftp.drupal.org/files/projects/dbtng_migrator-7.x-1.4.tar.gz
- gunzip /tmp/dbtng_migrator-7.x-1.4.tar.gz
- tar -xvf /tmp/dbtng_migrator-7.x-1.4.tar --directory /var/www/html/sites/all/modules
- 以管理员身份登录门户。
- 在 Drupal 菜单中选择 Modules。
- 启用 DBTNG Migrator 模块。
- 保存配置。
 
- 在基于 tar 的门户上,将 /var/www/html/sites/default/settings.php 修改为
    添加第二个数据库配置,该配置指向在基于 RPM 的
    。当前数据库配置命名为 default。为新配置命名
    自定义:
 $databases = array ( 'default' => array ( 'default' => array ( 'database' => 'devportal', 'username' => 'devportal', 'password' => 'devportal', 'host' => 'localhost', 'port' => '', 'driver' => 'mysql', 'prefix' => '', ), ), 'custom' => array ( 'default' => array ( 'database' => 'newportaldb', 'username' => 'apigee', 'password' => 'postgres', 'host' => '192.168.168.100', 'port' => '5432', 'driver' => 'pgsql', 'prefix' => '', ) ) );
 其中 host 和 port 指定了 Postgres 服务器。Postgres 使用端口 5432 进行连接。
- 
      在基于 tar 的门户上,安装 Postgres 驱动程序:
      <ph type="x-smartling-placeholder">- </ph>
        
- 使用 Yum 安装驱动程序:
 >yum 安装 php-pdo_pgsql
- 将 /etc/php.ini 修改为
        将以下代码行添加到该文件中的任意位置:
 extension=pgsql.so
- 重启 Apache:
 >服务 httpd 重启
 
- 使用 Yum 安装驱动程序:
- 
      在基于 tar 的门户上,将门户数据库迁移到基于 RPM 的门户
      门户:
      <ph type="x-smartling-placeholder">- </ph>
        
- 以管理员身份登录门户。
- 在 Drupal 菜单中,依次选择 Structure->Migrator。
- 在基于 tar 的门户上选择源数据库(default),并选择目标数据库。 自定义,基于 已显示 settings.php 文件 。
- 点击迁移。基于 tar 的数据库迁移到基于 RPM 的数据库 数据库。
 
- 复制 sites 目录
    从基于 tar 的服务器迁移到基于 RPM 的服务器。
 以下步骤中显示的路径基于默认路径。根据需要进行修改 安装。- 在基于 tar 的门户上,捆绑 /var/www/html/sites 目录:
 >cd /var/www/html/sites
 >tar -cvzf /tmp/sites.tar.gz。
- 复制 /tmp/sites.tar.gz 至 /opt/apigee/apigee-drupal/wwwroot/sites 在基于 RPM 的服务器上。
- 取消捆绑网站目录,但不覆盖重要文件。
          - 备份 settings.php 文件:
 >sudo cp /opt/apigee/apigee-drupal/wwwroot/sites/default/settings.php /opt/apigee/apigee-drupal/wwwroot/sites/default/settings.bak.php
- 备份现有的 files 目录:
 >sudo mv /opt/apigee/apigee-drupal/wwwroot/sites/default/files /opt/apigee/apigee-drupal/wwwroot/sites/default/files_old
- 备份现有的 sites 目录:
 >tar -cvzf /tmp/sites_old.tar.gz /opt/apigee/apigee-drupal/wwwroot/sites
- 将 sites 目录从基于 tar 的目录中进行解压缩和解压缩
            服务器:
 >Gunzip /opt/apigee/apigee-drupal/wwwroot/sites/sites.tar.gz
 
 >tar -xvf /opt/apigee/apigee-drupal/wwwroot/sites/sites.tar
- 请确保复制的文件具有正确的所有权:
 >chown -R apigee:apigee /opt/apigee/apigee-drupal/wwwroot/sites/
- 恢复 settings.php 文件:
 >sudo cp /opt/apigee/apigee-drupal/wwwroot/sites/default/settings.bak.php /opt/apigee/apigee-drupal/wwwroot/sites/default/settings.php
- 将私密文件移至新位置:
 >CP -r /opt/apigee/apigee-drupal/wwwroot/sites/default/files/private/* /opt/apigee/data/apigee-drupal-devportal/private
 
 >rm -rf /opt/apigee/apigee-drupal/wwwroot/sites/default/files/private
 
 >chown -R apigee:apigee /opt/apigee/data/apigee-sap-drupal-devportal/private
 
- 备份 settings.php 文件:
 
- 在基于 tar 的门户上,捆绑 /var/www/html/sites 目录:
- 在基于 tar 的门户上(前提是您更改了网络根目录的路径)
    目录(位于基于 tar 的门户上,默认路径为 /var/www/html):运行 drush status 并查看 files 路径和 private files 路径:
 >cd /var/www/html
 >Drush 状态
 
 如果文件/不公开文件不在 sites 目录下,请将其复制到基于 RPM 的 如上所示
- 在基于 RPM 的门户上,更新 /opt/apigee/apigee-drupal/wwwroot/sites/default/settings.php
    以设置默认数据库的属性:
 >六 /opt/apigee/apigee-drupal/wwwroot/sites/default/settings.php
 
 在 settings.php 中设置默认数据库说明:
 $databases = array ( 'default' => array ( 'default' => array ( 'database' => 'newportaldb', 'username' => 'apigee', 'password' => 'postgres', 'host' => 'localhost', 'port' => '5432', 'driver' => 'pgsql', 'prefix' => '', ) ) );
 其中,database 指定您创建的新数据库; username 和 password 与自定义数据库的定义相同 (基于 tar 的门户),且 prefix 为空。
- 
      在基于 RPM 的门户上,基于 RPM 的门户版本包含的更少
      Drupal 模块高于基于 tar 的版本。迁移到基于 RPM 的门户后,您可以
      必须检查是否有任何缺失的模块,并根据需要进行安装。
      - 安装用于检测缺失的 Drupal missing_module
        模块:
 >cd /opt/apigee/apigee-drupal/wwwroot
 >drush dl missing_module
 >drush en missing_module
- 以管理员身份登录基于 RPM 的门户。
- 选择报告 >状态报告,并检查 任何缺失的模块。
- 使用该报告安装任何缺失的模块,或使用以下命令:
 >cd /opt/apigee/apigee-drupal/wwwroot
 >drush dl <模块 A><moduleB>...
 >drush en <moduleA><moduleB>...
- 启用所有模块后,请确保文件归 apigee 所有
        用户:
 >chown -LR apigee:apigee /opt/apigee/apigee-drupal/wwwroot
 
 如需详细了解文件权限,请参阅 https://www.drupal.org/node/244924。
 
- 安装用于检测缺失的 Drupal missing_module
        模块:
- 
      在基于 RPM 的门户上,请在浏览器中运行 update.php,以删除
      缺少的模块:
      <ph type="x-smartling-placeholder">- </ph>
        
- 以管理员身份登录基于 RPM 的门户。
- 在浏览器中,前往以下网址:
 http://{portal_IP_or_DNS}:8079/update.php
 
 其中 portal_IP_or_DNS 是 基于 RPM 的门户。
- 按照屏幕提示操作。
 
- 更新 DNS 条目,使其指向基于 RPM 的新门户。
 
 请注意,基于 RPM 的门户版本默认使用端口 8079,而基于 tar 的门户版本 使用端口 80确保您在 DNS 条目中使用了正确的端口号。如需了解相关信息,请参阅设置门户使用的 HTTP 端口 其他端口
转换已完成。