如何在Drupal环境之间迁移CCK字段? [英] How do you migrate CCK fields between environments in Drupal?

查看:100
本文介绍了如何在Drupal环境之间迁移CCK字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Content Construction Kit (CCK)是最有用的Drupal模块之一。它允许您轻松地将自定义字段添加到内容类型。

The Content Construction Kit (CCK) is one of the most useful Drupal modules. It allows you to easily add custom fields to a content type.

但是,这些新字段通过Drupal本身创建并存储在数据库中。这意味着如果您更改开发环境中的CCK字段,则需要在测试和生产环境中手动进行相同的更改。

However, these new fields are created through Drupal itself and stored in the database. This means that if you change a CCK field in your development environment you need to manually make the same change in your test and production environments.

更糟的是,没有简单的方法确定您的环境是否已经失去同步。所以,如果你不经意间混淆或者忽略了一个变化,你可能不会意识到这一点。

Worse, there's no simple way to determine if your environments have gotten out of sync. So if you ever inadvertantly mess up or omit a change as you put it into test or production you may never realise.

我正在寻找一种允许我导出支持的CCK字段定义:

I'm looking for a technique that allows me to export CCK field definitions that supports:


  • 导入新环境(显然)

  • 创建新字段

理想情况下,出口也将支持:

Ideally the export would also support:


  • Diffing

  • 修改现有字段

  • 删除现有字段

  • 某种冲突解决方案数据与现场更改冲突的情况

  • Diffing
  • Modification of existing fields
  • Deletion of existing fields
  • Some kind of conflict resolution in situations where data clashes with field changes

解决方案越简单越重要。我想避免自定义脚本或GUI自动化,除非有一个非常干净的方法来实现。

The simpler and more repeatable the solution the better. I would like to avoid custom scripting or GUI automation unless there is a very clean way to do this.

推荐答案

你知道吗作为标准cck包的一部分的内容复制模块?它在某种程度上为字段和整个内容类型提供导出/导入功能。

Are you aware of the Content Copy module that is part of the standard cck package? It offers export/import functionality for fields and whole content types to some extent.

它不提供差异本身,我不知道它是如何做的已经存在的字段的修改,但它有助于移动新的字段和/或内容类型。

It does not offer diffing by itself, and I'm not sure about how well it does modifications of already existing fields, but it helps a lot for moving new fields and/or content types.

另外,您可以保存来自不同实例和diff的输出输出他们在本地,这给你一个很好的变化概述(特别是显示不同步情况快速)。

Also, you can save the output of exports from different instances and diff them locally, which gives you a pretty good overview of changes (especially revealing 'out of sync' situations quickly).

启用后,检查新的导出和导入标签'/ admin / content / types'的顶部。

After enabling, check the new export and import tabs on top of '/admin/content/types'.

这篇关于如何在Drupal环境之间迁移CCK字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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