从dev - >阶段 - >生产中迁移(CMI)配置的建议工作流程是什么? -- migration 领域 和 8 领域 和 version-control 领域 drupal 相关 的问题

What is the suggested workflow for migrating (CMI) configuration from dev -> stage -> production?





我们在房间里最好弄清楚(部分基于Drupalcon Portland的演示)是:

  • 告诉版本控件忽略Active Config目录。
  • 将所有配置复制到暂存目录并提交版本控件。

并使用settings.php在2个环境之间反向活动/暂存目录。但是,在弄清楚从一个服务器到下一个服务器的部署工作流程复杂但可行的,而可行的,多个本地环境(即多个开发人员)的建议工作流程是什么进入DEV(或彼此之间) - 可能的问题是每个团队成员将分享相同或类似的环境,因此一个队友的机器的更改如何过来?


We had a drupalcamp a few months back and someone asked about managing deployments with the new config (CMI) system. One possible ideal workflow would involve keeping the config in version control and still being able to migrate configuration between team members.

The best that we in the room were able to figure out (partially based on the presentation at DrupalCon Portland) was:

  • Tell version control to ignore active config directory.
  • Copy all Configuration over to staging directory and commit to version control.

And use settings.php to reverse active/staging directory between the 2 environments. However, while figuring out a deployment workflow from one server to the next was complex but doable, what is the suggested workflow from multiple local environments (ie multiple developers) into dev (or between each other) - A possible issue would be every team member would be sharing the same or similar environment so how do changes on one teammate's machine come over?







  • 已提到,有活动和暂存目录。 Active由Drupal完全管理,不支持直接在那里进行更改(通过切换到不同位置的直接或间接)。
  • 暂存是Drupal寻找配置进口和否则不关心它。
  • 导入过程很重要,配置更改可以以某种方式影响一个站点,并且需要检查有效性。例如,您无法将文本字段的字段类型更改为实体引用,例如,它只是不起作用。
  • 配置导入始终需要在所有配置上运行,无法导入单视图或节点类型。它被尝试,但试图应对依赖关系,删除/重命名,因此导致了一个非常复杂的系统,它不起作用。
  • 重新安装默认配置的唯一方法是重新安装该模块。这意味着它将首先尝试删除所有配置(如字段)。所以这不是一个选择。手动,更新功能的具体变化是可能的,但我认为这是太乏味。
  • 在功能模块描述时,它将重点关注提供可重用的功能,而不是连续部署配置。这是它首先设计的。

鉴于此,现在的建议是将暂存目录放入版本控制。然后,每个开发人员都完全控制了他在那里的情况下,通过复制整个Active Directory,或只是特定的配置文件。然后提交暂存目录更改,推送到生产,运行配置导入(在UI或疏浚中)。


After talking a bit with CMI maintainers, the discussion on what's the best approach isn't finished but the following is what makes the most sense at the moment.

Trying to keep it terse for now, will try to expand based on questions/when the referenced issue is resolved with an official answer.

So, first, the facts...

  • As already mentioned, there's the active and staging directory. Active is fully managed by Drupal, making changes directly in there (direct or indirect by switching to a different location) is not supported.
  • Staging is where Drupal looks for configuration to import and doe otherwise not care about it.
  • The import process is important, configuration changes can affect a site in a certain way and needs to be checked for validity. You can't change the field type of a text field to an entity reference, for example, that just doesn't work.
  • The config import always needs to run on all configuration, you can't import a single view or node type. It was tried, but trying to cope with dependencies, removes/renames and so on resulted in an very complicated system and it didn't work.
  • The only way to re-install default configuration, is to re-install that module. Which means that it would first try to remove all configuration (like fields). So that's not really an option. Manual, specific changes in update functions are possible but too tedious for this I think.
  • As the features module describes, it will be focused on providing re-usable functionality, not continuous deployments of configuration. This is what it was designed for in the first place.

Given that, the recommendation right now is to put the staging directory into version control. Each developer has then full control over what he puts there, either by copying the whole active directory over, or just a specific configuration file. The staging directory changes are then committed, pushed to production and the configuration import is run (in the UI or with drush).


我们最近开始了一个Drupal 8项目,并实施了以下工作流程。


我们目前的Drupal 8项目模板可在GitHub上获得。我还写了一些方便的Drush命令来加快Devleoper Worflow。无需手动复制到所需导出。

  • 项目模板: https://github.com/webflo/d8-project-templateuptuptuptut
  • 额外的drush命令: https: //github.com/webflo/d8-project-template/blob/master/public/drush/cmi.drush.inc

Great answered so far. Thanks you all!

We started a Drupal 8 project recently and implemented the following workflow.

We have three folders active, staging and export. Developers dump their to export. I donxc2xb4t want to keep it in stageing. I thinks its easier to work with when the shared configuration is not directly stored in the staging folder. Itxc2xb4s just a felling i have no hard facts on this ...

Our current drupal 8 project template is available on github. I also wrote some handy drush commands to speed up the devleoper worflow. No manual copying from active to export required.

  • Project template: https://github.com/webflo/d8-project-template
  • Additional Drush commands: https://github.com/webflo/d8-project-template/blob/master/public/drush/cmi.drush.inc

我还没有尝试过,但我的计划是创建一个自定义模块,其中包含仅包含我关心的配置的"默认" 配置文件。我认为其他模块可以包含覆盖其他模块的配置。 (如果不是这应该是可能的)。




  1. git pull或其他什么可以获得新文件。
  2. 清除缓存。
  3. 重置默认配置。 (来自您的自定义模块的文件)



I haven't tried this yet, but my plan is to create a custom module that contains "default" config files containing only the configuration I care about. I believe other modules can contain configs that override other modules. (If not this should be made possible).

I think you must leave the config folder alone. Ignore it. It is auto generated on install from all of the individual modules' configuration files. The path is long and random. If you kept all of that in a repo, you would need a separate repo and you would be carrying along with it tons of default, unneeded config files.

Putting config in a custom module makes it a part of you main codebase.

The deploy process would be:

  1. Git pull or whatever to get new files.
  2. Clear caches.
  3. Reset default config. (From your custom module's files)

You can create custom modules (with it's own config) for each environment if you want.


注意: 我很欣赏,这不是关于问题的最严格的答案,但无论如何我把它放在这里我会重新审视和编辑/删除一次,功能有8.x释放,灰尘已经解决了更多。这对评论来说太大了,我想得到我的0.02英镑: - )




3.x版本的功能计划用于Drupal 8,与新的配置管理系统集成。如果您只需导出 简单的站点配置,D8配置管理系统 应该使用而不是特征。您将在D8中使用功能 导出捆绑功能(如"照片库功能" )。

I 有点的方式,看看它是这个想法使DEV 团队更容易工作,以便在网站的较小部分上工作。我不打算进入工作流程,但由于仍有太多未知的变量,但我看不到它与当前功能部署过程有很多不同。



Note: I appreciate that this isn't an answer in the strictest sense in relation to the question, but I've put it here anyway and I'll revisit and edit/delete once Features has an 8.x release and the dust has settled a bit more. This was just too big for a comment and I wanted to get my xc2xa30.02 in :-)

As a massive fan of Features, I'd suggest keeping an eye on the Features module's D8 incarnation.

Taken from the project page

3.x version of Features is planned for Drupal 8 to integrate with the new configuration management system. If you simply need to export simple site configuration, the D8 configuration management system should be used instead of Features. You will use Features in D8 to export bundled functionality (like a "photo gallery feature").

The way I kinda see it is that this idea makes it easier for dev teams to work on smaller parts of a site. I'm not going to go into a workflow yet though as there are still too many unknown variables, but I can't see it being THAT much different from a current Features deployment procedure.

I can't help but think yes, CMI is awesome; but most of my sites will still end up with Features modules (albeit a smaller amount due to not having to export EVERY content type, permission etc)



-2  如何使用DRUSH或MIGRATE模块为每小时创建/编辑/删除节点  ( How to use drush or migrate module to create edit delete nodes hourly ) 
我需要 从Drupal DB(X_Table)中的新表/字段每小时创建新节点(W / 12字段)。 通过当前x_table行创建的节点。 一旦从x_table删除行一旦删除行。 我的技能组不包括编码,多年来我通过伟大的Drupal模块得到了多年的,尽管我没有进口/更新/删除旋转10,000+节点。我以前...

1  如何在Drupal中迁移内容编辑从暂存到现场环境  ( How to migrate content edits in drupal from staging to live environment ) 
我有脱落的环境,我曾经先添加和更新内容,而不是通过QA传递的更改,而不是将其移动到实时站点。 我不能使用 backup and migrate 模块,因为数据库的尺寸较大。 还可以使流程自动制作,因此每天我都不需要手动将内容从停车场迁移到实时站点。 ...

0  将Drupal站点上传到服务器进行测试[关闭]  ( Upload a drupal site to the server to test ) 
关闭。这个问题需要更多聚焦。它目前不接受答案。 想要改进这个问题?更新问题,因此它仅关注一个问题,只有编辑此帖。 关闭 7年前。 ...

0  如何检查问题是否在将数据库从一个服务器迁移到另一个服务器时清除URL?  ( How to check if the problem is of clean url when migrating the database from one ) 
上传我的本地DB在服务器上我的网站没有工作,我得到的是白屏死亡。在几个小时的努力之后,我发现,由于服务器未配置为CLEAT URL和数据库中的CLEAD URL设置,导致问题。 是否有任何方法我们可以知道问题是否在这种情况下的清洁网址。 此外,我不能使用备份和迁移模块,因为数据库大小太大。 ...

1  将数据库内容迁移到新服务器  ( Migrating database content to a new server ) 
我正在将一个drupal站点移动到新服务器上。我正在使用Putty将数据库SCP到此新服务器上;我以前没有这样做过,所以有些东西我不确定。 在服务器上的MySQL中有一个名为"网站" 的数据库,而我的原始数据库名称实际上是'mydrupalesite'。如果我只是将文件mydrupalsite.sql导入数据库'网...

6  迁移到多价字段集合中  ( Migration into multi value field collection ) 
我正在尝试在此问题的注释#222中使用补丁( https://drupal.org/node/ 1175082#评论-7625869 )将数据迁移到多值现场集合中。 我在Bredicerow()中创建了一系列对象(),但是当迁移完成并查看节点时,只有数组中的第一个项目填充了字段集合,并且没有添加后续项目。我错过了重...

3  如何正确迁移日期字段?  ( How to migrate date fields correctly ) 
我想将分类术语从传统数据库迁移到我的Drupal 7安装。这几乎根据需要工作。我所做的是基本上定义如任何迁移示例中所述的映射,例如: $this->addFieldMapping('name', 'legacy_name'); 但是当我尝试迁移日期时,我完全失败了。这不起作用: $this->addFi...

1  Migrate模块和地址域位置/ City Lookup在Bregryerow失败失败  ( Migrate module and addressfield locality city lookup in preparerow fails ) 
我正在运行迁移,将志愿者从CSV文件移动到Drupal。我写了以下代码。 <?php /** * @file * Migration for Volunteer File */ ini_set('auto_detect_line_endings', TRUE); class Voluntee...

0  迁移到新服务器后的视图模块错误  ( Views module error after migrating to new server ) 
今天将我的网站(在Drupal 7)在线推出后,我从"View" 模块中获得了一些奇怪的错误。在我的本地机器上一切正常工作,但在线我只是继续得到这些错误!我已经检查了PHP版本,PHP限制,托管空间,..等,一切都很好。我尝试删除所有我的观点并添加新的视图,但这也不起作用;当我试图保存时,没有任何反应。这些是我所谈话...

1  迁移模块和常量源文件  ( Migrate module and a constant source file ) 
在我的迁移模块中,我有源文件(它是CSV)的路径,指向我服务器上存在的文件。那部分效果很好。如果我上传文件并重命名它(使用文件浏览器模块),以便上传的文件与迁移源文件相同,我得到一些奇怪的行为。 迁移导入概述页面不会抱怨文件丢失,但不动的行数的计数是负$ x,其中$ x是导入的行数(来自上一个运行)。因此,如果我之前...

1  迁移模块:如何处理添加重定向和回滚?  ( Migrate module how to handle adding redirects and rolling back ) 
我正在使用迁移模块编写一些迁移。我需要在迁移项目后设置重定向,但我不确定在哪里执行该操作。 我可以在迁移的完整()函数中进行,在每个对象已成功插入后调用。此时,我有足够的信息来编程方式添加重定向。 但是,如果我需要回滚迁移,我没有看到我可以放入任何清理的代码以删除这些重定向。有前回滚函数,但在整个迁移回来之前调用这些...

2  如何使用迁移模块将多值字段导入配置文件2  ( How to import multi value fields into profile2 using the migrate module ) 
我拥有使用Profile2模块的配置文件的用户。我正在使用一个 cookbook 基于迁移 framework 创建用户和导入配置文件数据。 样本CSV数据是: "member_nr","email","username","tel_1" "1001","new.tester@example.com","new ...

1  迁移后开发到实时生产服务器问题  ( Post migrate development to live production server issue ) 
我在今天成功完成了这一点,而是在今天从Localhost开发(Ubuntu)测试一个项目到实时生产服务器(共享服务器,一般市场提供商ALA Bluehost),我正在获得白色屏幕通过phpmyadmin导入主FileName.sql后的死亡(WSOD),我不确定为什么它不正常工作。 这是我正在做的事情: 1) - ...

2  将分隔的文本字段映射到迁移中的分类系统  ( Mapping delimited text field to taxonomy field in migrate ) 
我的迁移来自当前正常工作的外部(非Drupal)DB。我正在尝试从外部数据库添加一个字段,其中包含分隔的术语列表。 我已经设置了如下所示的字段映射: $entityoptions = variable_get('entitydropdown'); 0 我想动态将这些术语添加到Field_test_struc...

3  如何用层次结构迁移分类法?  ( How to migrate taxonomy with hierarchy ) 
我正在尝试从普通的迁移数据库表中创建分层分类,如下所示: ID | NAME | PARENT ------------------ 0 | FOO | 1 | BAR | 2 | LORE | FOO 3 | IPSE | FOO 4 | DOLO | BAR 这...

2  从Drupal 5到7迁移CCK字段内容  ( Migrate content of cck fields from drupal 5 to 7 ) 
我需要将特定内容类型的内容与束文本菲尔德CCK转移到新D7网站,是我发现很多方法可以通过互联网做这样的事情,我想知道最简单和最简单的事情最快的方法。 我从drupal 5到7迁移。 ...

0  Drupal迁移和404错误  ( Drupal migration and 404 errors ) 
我已经在本地设置了Drupal 7网站,将网站与ISP的服务器一起设置为运行PHP和MySQL的Linux框。 我之前从未成功登录远程站点,我已经锁定了自己,因为我得到了管理密码错误。当我走到 http://www.example.com/?q=user 并单击请求新密码然后我收到此错误: Not Found ...

2  没有.htaccess文件的后果是什么?  ( What are the consequences of not having an htaccess file ) 
如果我安装了.htaccess文件,那么我会得到http 500错误,但如果我重命名它,那么我可以进入站点 - 虽然没有到节点。 我不确定是否在那里追求.htaccess文件。系统在本地工作,我试图在我的ISP上安装它。 ...

1  将Drupal安装移动到子目录  ( Moving a drupal installation to a subdirectory ) 
好的,我有一个Drupal安装,在各种节点内有很多链接。所有这些链接都是相对的。 问题是,如果它们会在/站点/默认/文件目录中发送图像或pdf,则停止工作。 让我举个例子: 节点中有一个如此: /sites/default/files/image1.png www.livesite.com/sites/...

2  如何避免调用fieldcollectionity :: deleterevision  ( How to avoid calling fieldcollectionitementitydeleterevision ) 
抱歉令人困惑的名字。我有以下问题。我对包含多值现场收集项的内容类型(每个内容平均平均有〜50项)的迁移。迁移相当快,150件物品/分钟。但是,迁移更新非常慢,10项/分钟。我用Xhprof和95%的时间检查了它在 FieldCollectionItemEntity::deleteRevision 中的95%的时间 -...

© 2021 it.wenda123.org All Rights Reserved. 问答之家 版权所有

Licensed under cc by-sa 3.0 with attribution required.