简体   繁体   English

如何将 WordPress 内容从 Dev 部署到 Staging 到生产环境?

[英]How to deploy WordPress content from Dev to Staging to Production environments?

We inherited a WordPress website and set up Dev, Staging and Production environments.我们继承了一个 WordPress 网站,并设置了 Dev、Staging 和 Production 环境。 Deploying code changes to each environment (eg going from Dev to Staging) has been simple to do by putting the code in Git.通过将代码放在 Git 中,可以很容易地将代码更改部署到每个环境(例如从 Dev 到 Staging)。

However, we're not sure how to do the same with WordPress content that lives in the database and files in the wp-content/uploads directory.但是,我们不确定如何对数据库中的 WordPress 内容和 wp-content/uploads 目录中的文件执行相同的操作。

We'd like to use our Dev site as the source of truth, prepare content changes in there, and then deploy those content changes to Staging and Production, just like we would do with code.我们希望使用我们的 Dev 站点作为事实来源,在那里准备内容更改,然后将这些内容更改部署到 Staging 和 Production,就像我们处理代码一样。

Some of the situations we have to handle:我们必须处理的一些情况:

  • Only deploying content (and not users) from one environment to another仅将内容(而非用户)从一个环境部署到另一个环境
  • Being able to deploy changes live outside the wp_posts table.能够在wp_posts表之外实时部署更改。 For example, if we change menus in Appearance > Menus, that's stored elsewhere in the WordPress DB.例如,如果我们在外观 > 菜单中更改菜单,它会存储在 WordPress 数据库中的其他位置。
  • Making sure that any hard-coded absolute URLs (eg in images, links, widgets, etc) are not deployed with hard-coded domains (eg dev.mydomain.com)确保任何硬编码的绝对 URL(例如在图像、链接、小部件等中)未与硬编码域(例如 dev.mydomain.com)一起部署

Is there a standardized way to handle a content deployment pipeline in WordPress from Dev to Staging to Production?是否有一种标准化的方法来处理 WordPress 中从开发到登台再到生产的内容部署管道?

We're looking at plugins, but none of them seem to achieve this to a full extent.我们正在研究插件,但似乎没有一个能完全实现这一点。

Thanks谢谢

You're looking for an ETL (Extract - Transform - Load) script most likely.您最有可能正在寻找 ETL(提取 - 转换 - 加载)脚本。 It would pull the tables you want.它会拉出你想要的桌子。 Extract -提炼 -

  • Wp_posts wp_posts
  • wp_postmeta wp_postmeta
  • wp_terms wp_terms
  • wp_termmeta wp_termmeta
  • wp_term_taxonomy wp_term_taxonomy
  • wp_term_relationships wp_term_relationships
  • any plugin tables not in the wp core.不在 wp 核心中的任何插件表。

Or you could probably take all tables excluding:或者您可以将所有表格排除在外:

  • wp_users wp_users
  • wp_usermeta wp_usermeta
  • wp_options wp_options

Then run a search and replace for absolute urls.然后运行搜索并替换绝对网址。

Finally load the tables into the next environment.最后将表加载到下一个环境中。

You can write it manually or use a program like Talend Open Studio for Big Data您可以手动编写或使用Talend Open Studio for Big Data 之类的程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何处理多种环境:使用 paypal webhook 进行开发、登台和生产? - How to handle multiple environments: dev, staging and production with paypal webhooks? localhost + staging +生产环境? - localhost + staging + production environments? 人们如何处理内容管理系统生产阶段? - How are people handling content management system production staging? 用于开发生产环境的Postgres数据库设置 - postgres database setup for dev staging production enviroment 在开发,登台和生产之间同步Drupal站点 - Syncing Drupal site between dev, staging and production 如何在本地开发环境中使用WordPress安装Tollmanz Memcached对象缓存 - How to install the Tollmanz Memcached Object Cache with WordPress in Local Dev Environments WordPress开发与生产环境 - Wordpress Development VS Production Environments 使用git部署到临时版本和生产版本到不同的位置 - Using git to deploy to staging and production versions to different locations 在PHP应用程序中,使用什么方法来区分生产/阶段/开发环境? - What methods are used for differentiating between production/staging/development environments in PHP applications? 如何使用 symfony 环境 dev 和 prod - How to use symfony environments dev and prod
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM