Opencart数据库部署从开发到生产

标签 opencart mysql

我正在尝试在开发、验收和生产之间创建数据库部署计划。问题是,当我从验收中转储数据库,然后导入到生产环境时,它会覆盖所有客户数据。

为了解决这个问题,我选择忽略 mysqldump 命令中的以下表格:

oc_address
oc_coupon_history
oc_custom_field_to_customer_group
oc_customer
oc_customer_ban_ip
oc_customer_field
oc_customer_group
oc_customer_group_description
oc_customer_history
oc_customer_ip
oc_customer_online
oc_customer_reward
oc_customer_transaction
oc_order
oc_order_download
oc_order_field
oc_order_fraud
oc_order_history
oc_order_option
oc_order_product
oc_order_recurring
oc_order_recurring_transaction
oc_order_status
oc_order_total
oc_order_voucher
oc_paypal_order
oc_paypal_order_transaction
oc_return
oc_return_action
oc_return_history
oc_return_reason
oc_return_status
oc_review
oc_tax_rate_to_customer_group
oc_voucher_history

是否有我遗漏的包含客户/交易数据的表?我这样做会遇到任何问题吗?

我还将忽略 oc_settings 表,以防止生产付款设置被覆盖。

现有的 Opencart 商店如何处理内容创建过程?他们肯定不会直接编辑作品。

任何建设性的答案将不胜感激。

Opencart版本1.5.6

最佳答案

Are there any tables I have missed which contain customer/transaction data? And will I run into any issues doing this?

您可能想要包括:

voucher
voucher_history

并省略(这些更类似于系统设置):

order_status
order_field

How do existing Opencart stores handle the content creation process? Surely they are not editing production directly.

这或多或少是基于意见的,这里不鼓励这样做,但我会冒险回答。

你所做的绝对没有问题。直接编辑生产数据库也没有问题。

我经常使用这样的过程:

  • 编写并测试一个简单的脚本,以导入包含产品数据的 csv 或 xls 文件。有一些工具可以实现这一点,但根据我的经验,它们都不够详细,无法处理经常出现的复杂情况。无论如何,一旦您获得了可用的脚本,将来从同一数据源更新数据应该是一件轻而易举的事。
  • 将生产数据库复制到开发
  • 运行导入脚本
  • 检查并确保没有发生灾难性事件
  • 将开发产品表复制回生产

这里有无数的工作流程可能性,最终只有您才能确定最适合您业务的工作流程。

关于Opencart数据库部署从开发到生产,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30311850/

相关文章:

php - Laravel 中 Controller 查询 foreach 循环出现问题

当 LIMIT 太高时,PHP 的 PDO 查询不执行?

php - Opencart 版本 1.5.1.3 安装在 IIS 7 上。如何获得 SEO 友好 URL?

html - DIV 高度不是 100%

python - python 中的 switch case 程序

java - 在自定义数据源操作中使用条件

php - opencart需要加载ZIP扩展

php - 在 Opencart 中使用扩展

mysql - 如何通过VQMOD创建新的数据库表(如果不存在)

mysql - CONCAT子串