Drupal DATABASE部署策略? [英] Drupal DATABASE deployment strategies?

查看:108
本文介绍了Drupal DATABASE部署策略?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从此项目:什么是最好的Drupal部署策略?报价:

From this item: What's best Drupal deployment strategy? .... I quote:


数据库很棘手;清理开发人员/分期数据库并将其推送到现场是最简单的初步部署,但如果用户在现场网站上也产生内容,则在执行增量数据库更新时会出现一些皱纹。

Databases are trickier; cleaning up the dev/staging DB and pushing it to live is easiest for the initial rollout but there are a few wrinkles when doing incremental DB updates if users on the live site are also generating content.

我想要一些如何做到这一点的想法?目前,我在本地机器上获得了现有数据库的完整副本,提交了该subversion,然后部署整个数据库。目前的文件是15megs,每次我必须上传整个文件(我认为颠覆将它视为一个全新的文件,因为它每次都有这么多变化)。

I want some ideas on how to do this? Currently I get a complete copy of the existing db on my local machine, commit that subversion, and then deploy the whole database. Currently the file is 15megs, and each time I have to upload the whole file (i think subversion sees it as a whole new file, because it has so many changes each time).

所以,我的问题是真的:

So, my questions are really:


  1. 提交时,如何减小Db尺寸(不是提交不太频繁)?

  2. 有什么其他方式可以保持我的数据库和服务器数据库同步吗?特别是考虑到用户会一直发布新的数据?


推荐答案


有没有其他方法来保持我的数据库和服务器数据库同步?特别是考虑到用户将一直在发布新的数据?

Is there any other way to keep my db and server DB in synch? especially considering that users will be posting new data all the time?

我们拥有一个庞大的分布式团队和编辑人员,无处不在,所以部署数据库是不可行的

We have a large distributed team and editorial staff everywhere so deploying the database is not feasible.

为了解决这个问题,我们广泛使用了更新功能。我们有一个模块没有真正的代码,我们用于更新设置。每次开发人员进行配置更改时,都会在此模块中写入更新功能,运行时将对其他开发数据库进行相应的更改,分段和生效。

To get around this we make extensive use of update functions. We have a module which has no real code, which we use for updating settings. Every time a developer makes a configuration change they write an update function in this module which when run will make the corresponding change on the other development DBs, staging and live.

有一些问题,特别是交叉依赖(如果人们在多个模块中编写更新功能),并且需要时间来编写相对较小更改的内容在管理中。 安装个人资料api 有助于此。

There are issues, particularly with cross dependencies (if people write update functions in more than one module), and it can take time to code something that is a relatively minor change in the admin. Install profile api helps in this.

对于示例

function mysite_update_6000() {
  install_include(array('user'));
  $editor_rid = install_add_role('editor');
  install_add_permissions(DRUPAL_ANONYMOUS_RID, array('do something'));
  install_add_permissions($editor_rid, array('do something', 'administer nodes'));
  return array();
} 

将添加角色并为其分配一些权限。这样做可以保存代码中的所有更改,以便您不必尝试迁移和同步数据库。

Will add a role and assign some permissions to it. Doing this keeps all of the changes in the code so that you don't have to try to migrate and synchronise databases.

还有一个迁移模块,这可能有助于此,它将更改记录到表并将其保存到更新功能。这不是与用于内容迁移的drupal.org迁移模块混淆。

There is also a migration module which may help with this, it logs changes to tables and saves them to an update function. This is not to be confused with the drupal.org migrate module which is for content migration.

我们已经取得了一些成功,但也有一些问题与功能模块,可以帮助迁移功能。

We have had some success, but also some issues with the features module, which can help with migrating features.

这篇关于Drupal DATABASE部署策略?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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