# 克隆到服务器，使用 WordPress SSO

**URL:** <https://meta.discourse.org/t/cloning-to-server-with-wordpress-sso/131363>\
**Category:** Support\
**Created:** [2019年十月18日 14:49 UTC](https://meta.discourse.org/t/cloning-to-server-with-wordpress-sso/131363 "2019-10-18T14:49:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![markwill](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@markwill](https://meta.discourse.org/u/markwill)\
**Post date:** [2019年十月18日 14:49 UTC](https://meta.discourse.org/t/cloning-to-server-with-wordpress-sso/131363/1 "2019-10-18T14:49:30Z")

</div>

我遇到了一个与 SSO 相关的问题，特别是关于从生产服务器克隆的情况。出于开发、测试等各种原因，我想将生产服务器克隆到另一台服务器。我将通过一个例子来说明：

假设我的生产服务器是 www（WordPress）和 forum（Discourse）。SSO 正在运行，一切正常。

我还希望拥有例如 www2（WordPress）和 forum2（Discourse），并将 forum 服务器的所有内容迁移到 forum2。假设 DNS 已经配置妥当。

我计划的流程如下：

- 备份 forum
- 保存 forum2 的设置
- 将备份恢复到 forum2
- 恢复之前保存的设置（来自 forum2）

如果我不使用 SSO，这一切都很稳妥。但在使用 SSO 的情况下，我遇到了问题。恢复后，forum2 仍然指向 www（而不是 www2）作为其 SSO 授权源，导致我甚至无法登录。

我该如何/在哪里在恢复后修改 www2，使其指向 www2？

谢谢。

---

<div class="post-metadata">

**Author:** ![markwill](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@markwill](https://meta.discourse.org/u/markwill)\
**Post date:** [2019年十月18日 14:57 UTC](https://meta.discourse.org/t/cloning-to-server-with-wordpress-sso/131363/2 "2019-10-18T14:57:29Z")

</div>

我刚刚想到，如果在从备份恢复之前，先在 forum2 上配置 SSO 指向 www2，那么这些设置应该会包含在我保存的配置中。

这样可行吗？（我可以尝试一下，但如果有人对这种方案是否最佳有见解，我将不胜感激。）

---

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [2019年十月18日 17:03 UTC](https://meta.discourse.org/t/cloning-to-server-with-wordpress-sso/131363/3 "2019-10-18T17:03:41Z")

</div>

> [@markwill](#):
>
> 恢复后，forum2 的 SSO 授权地址已指向 www（而非 www2），导致我无法登录。

恢复后，您可以通过访问 `https://forum2.example.com/u/admin-login` 来绕过 forum2 的 SSO 登录。在该页面的表单中输入您的管理员邮箱地址。系统将向您发送一封包含管理员登录链接的邮件。登录成功后，请调整您的 SSO 设置。

---

<div class="post-metadata">

**Author:** ![markwill](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@markwill](https://meta.discourse.org/u/markwill)\
**Post date:** [2019年十月18日 17:49 UTC](https://meta.discourse.org/t/cloning-to-server-with-wordpress-sso/131363/4 "2019-10-18T17:49:40Z")

</div>

谢谢，Simon。不知为何，它在我这里无法正常工作。当我输入 /u/admin-logon 时，我直接被重定向到 www 进行 SSO。不过也许我漏掉了什么，我会再深入排查一下。

不过听起来这正是我需要的 🙂

---

<div class="post-metadata">

**Author:** ![markwill](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@markwill](https://meta.discourse.org/u/markwill)\
**Post date:** [2019年十月18日 19:01 UTC](https://meta.discourse.org/t/cloning-to-server-with-wordpress-sso/131363/5 "2019-10-18T19:01:17Z")

</div>

已正常工作，谢谢。

---

<div class="post-metadata">

**Author:** ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)\
**Post date:** [2019年十一月17日 19:13 UTC](https://meta.discourse.org/t/cloning-to-server-with-wordpress-sso/131363/6 "2019-11-17T19:13:18Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
