在生活的drupal网站上部署更改

Nil*_*ann 1 deployment drupal drupal-5

我真的很喜欢drupal.但最让我感到不安的是,我无法找到明确的部署方式.Drupal在数据库中存储了很多东西(视图,cck,工作流,触发器等),需要更新.

我已经看到了一些可用于此任务的模块(例如功能),我不确定它们是否足够.然而它们只适用于drupal6而且我目前必须在drupal5网站上工作,其中更新还不是一个选项.

有任何想法吗?

Rim*_*ian 5

这是一个弱点.Drupal没有内置的开发人员工具,这使得开发和部署变得像Rails一样容易(例如).一个问题是Drupal本身并不了解它的环境.其次,有太多不同的方法和模块需要特别小心.它会变得非常混乱.但随着匆匆和匆匆制造,情况会越来越好.

我假设您在本地计算机上有一个开发环境,并且您上传到的实时或临时服务器.

您要做的第一件事就是如何快速地将数据库夹具和代码与服务器连接到开发环境.您需要尽可能轻松地完成此过程,以便您可以毫不费力地保持站点的不同版本同步.这意味着您希望每次部署时都能够管理更少的更改.希望...

移动数据库并不是太难.您可以使用phpMyadmin或mysqldump,但备份迁移模块是我最喜欢的工具.

To upload code from your local repository or site can be done in a few ways. If you use a version control system like git, you can commit on your local machine and check out again on the staging server. There are also special deployment tools like capistrano you should take a look at. (if you know this stuff already it may benefit others to read). If you're using FTP you should probably try something different.

If you're working with a site that is still in production, you can afford to make small incremental changes to your local site, then repeat on the live site and down load the new version of the database when your changes are in place. This does mean you double handle the database but can be a safe way of doing things. It keeps both your database closer to each other and minimises risk.

You can also export views backup to your server in either your code or importing them into your live site. There is a hack to get around deploying cck changes here: http://www.tinpixel.com/node/53 it works OK but cannot truly manage changes like rollbacks. (Respect to the guy who wrote that)

You can also use hook_updateN to capture changes and then run update.php to apply them. I worked on a d5 site with dozens of developers and this was the only way to keep things moving forward. This may be a good option if your site is live or if you need all database schema changes captured in a version control system (so you can roll back).

Also: Take a look at drush and drush make. These tools can be of great benefit. I can't remember how much support is for d5.

处理此问题的最后一种方法是不使用cck或视图(并使用钩子更新).但这实际上只适用于拥有大量开发人员资源的企业站点.这似乎是一个奇怪的建议,但它可以完全否定整个问题.

对不起,我无法给你一个明确的答案.这是因为还没有.一旦你进入,你最终会找到自己的节奏.如果您可以轻松地回滚数据库,只需保留数据库的备份.