Drupal 多站点到单站点上线

发布于 2024-11-11 14:54:59 字数 287 浏览 2 评论 0 原文

我有一位同事要求我提供一个包含整个 Drupal 站点的 tarball,他们可以将其放在他们的服务器上,除了连接数据库之外无需任何配置。

据我所知,这是不可能的。

使问题进一步复杂化的是,该站点目前开发为多站点安装,而同事需要将其作为单站点安装提供。这是我已经做过无数次的转换,但我总是在目标环境上完成该过程,因为 Drupal 多站点需要一个指向它们的正确域才能运行。如果不先在该环境上进行实际测试,我就无法确认该网站是否可以在新位置运行,因此我认为我无法满足此请求。

我错过了什么吗?这实际上有可能实现吗?

I have a colleague asking me to provide a single tarball containing an entire Drupal site, which they can drop on their server with no configuration beyond connecting the database.

To my knowledge this is not possible.

To further complicate the issue, the site is currently developed as a multi-site install and the colleague needs it provided as a single-site install. This is a conversion I've done countless times, but I've always completed the process on the destination environment, because Drupal multi-sites need a proper domain pointed at them to function. There's no way for me to confirm that the site will work at the new location without actually testing it on that environment first, so I don't think I can fulfill this request.

Am I missing something? Is this in fact possible to achieve?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

樱&纷飞 2024-11-18 14:54:59

我不明白为什么这是不可能的。

关于安装中的下降,只要您包含settings.php文件和他们导入的数据库的副本,只要他们的网络服务器配置正确(例如漂亮的URL等),这就是他们所需要的一切)。当然,在执行此操作时需要考虑一些因素,您需要确保数据库连接路径是相对于本地主机(或他们拥有的)完成的,并且当您将其压缩在一起时,您已设置正确的权限对于目标机器,否则,移动 drupal 安装实际上并不那么困难,而且可以那么简单。

根据他们想要的“插入”方式,您可以编写一个小脚本来自动化和验证安装。让脚本导入数据库的副本,重做目标主机上文件的权限和所有者,然后重新加载 apache。

就多站点到单站点而言,我只需在沙箱中进行转换并在 /etc/hosts 中设置您需要的域(如图所示 此处)。这将很好地模拟目标域,以便您可以在发送之前确保安装正常运行。

希望有帮助。

I don't see why this isn't possible.

In regards to the drop in install, as long as you include the settings.php file and a copy of the DB that they import, that is all they should need as long as their webserver is configured properly (such as pretty URLs and the like). Certainly their are a few considerations to take when doing this, you need to make sure the DB connection path is done in relation to localhost (or however they have it) and that when you tarball it together, that you have the right permissions set up for the destination machine, otherwise though, moving a drupal install is really not that difficult and can be just that simple.

Depending upon how 'drop in' they want it, you could write a little script to automate and verify the install. Have the script import a copy of the DB, redo the permissions and owner of the files on destination host, and reload apache.

As far as the multi-site to single site is concerned, I would just do the conversion in a sandbox and set up the domain you need in /etc/hosts (as shown here). This will simulate the destination domain well enough that you can make sure the install is working before sending it off.

Hope that helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文