升级洪美客户流程
<p>升级洪美客户</p>
<p>=====================================================
用xshell登陆洪美生服务器
切换用户
su postgres
先把洪美数据库导出
pg_dump eb3_hongmei > /data/hongmei20180117.sql</p>
<p>==================================================</p>
<p>然后可以用winscp下载文件 /data/hongmei20180117.sql上传到测试服务器</p>
<p>用xshell登陆测试服务器</p>
<p>用navicat新建数据库eb3_hongmei,选择UTF-8 表空间选择zgsplace(如果不存在参照<a href="https://www.showdoc.cc/1689634?page_id=15610074">pg运维</a>新建一个表空间)</p>
<p>切换用户
su postgres
还原备份到新数据库
psql test_eb3_hongmei < /data/hongmei20180116.sql </p>
<p>然后把数据库变测试库
日常我们从客户那里复制一个正式库到公司,要做如下清洗;</p>
<pre><code>update s_shopid set shopname='测试'||shopname --店铺名前加测试
update s_company set companyname='测试'||companyname --组织名前加测试
update g_yongh set c_yonghmc='测试'||c_yonghmc --用户名前加测试
update g_yongh set c_newpass='e10adc3949ba59abbe56e057f20f883e' --密码修改为123456
update g_dianpqx set c_quanxvalue='-1' where c_quanxmc='设置短信发送方式' ---取消短信发送方式
update g_dianpqx set c_quanxvalue='0' where c_quanxmc='是否启用posE发送短信功能'--取消pose短信发送--
</code></pre>
<p>1.需要把短信发送关闭;
2.把用户名和店名、组织名称前面加上测试两个字;
3.把用户名的密码刷新为123456;</p>
<p>把sftp/share2.0/php/xxxx.upyuan.cn 目录下载然后上传到测试服务器</p>
<p>打开阿里云域名管理后台 解析新域名kehuyuan.9isoft.com 指定A记录到测试服务器ip</p>
<p>配置apache 网站目录
vim /etc/httpd/conf.d/vhost.conf </p>
<pre><code>
#################
&lt;VirtualHost *:80&gt;
#绑定的主域
ServerName kehuyuan.9isoft.com
#绑定的子域名
#ServerAlias www.test.com
#网站主目录
DocumentRoot /data/www/html/kehuyuan.9isoft.com/
#日志配置
#ErrorLog /home/web_log/kehuyuan.9isoft.com_error.log
#CustomLog /home/web_log/kehuyuan.9isoft.com_access.log common
#ServerSignature Off
&lt;/VirtualHost&gt;
#测试一的配置
&lt;Directory &quot;/data/www/html/kehuyuan.9isoft.com/&quot;&gt;
Options Indexes FollowSymLinks
#Options FollowSymLinks 不允许通过目录访问文件列表
AllowOverride All
Require all granted
&lt;/Directory&gt;
#######################
</code></pre>
<p>修改php_inc.php 的数据库连接方数</p>
<pre><code> define(&quot;connstring_write&quot;, &quot;host=localhost port=5432 dbname=eb3_hongmei user=postgres password=9Internetgly&quot;);
define(&quot;connstring_read&quot;, connstring_write);
define(&quot;connstring_report&quot;, connstring_write);
</code></pre>
<p>用navicat同步 eb3i数据库结构到 测试服务器的eb3_hongmei数据库结构
<img src="https://www.showdoc.cc/home/common/visitfile/sign/93cceaca5b513e80a0f0a1d65096dde0?showdoc=.jpg" alt="" /></p>
<h3><strong>注意 比对序列 不要勾选上 这里方法待补充</strong></h3>
<p>点对比
<img src="https://www.showdoc.cc/home/common/visitfile/sign/0b9d85e14d4d9cb8ed5a23a9c550333d?showdoc=.jpg" alt="" /></p>
<p>然后找出要创建的表</p>
<p><img src="https://www.showdoc.cc/home/common/visitfile/sign/7ad9d9c9809952c3bdd9b3ecb25d1f69?showdoc=.jpg" alt="" /></p>
<p><img src="https://www.showdoc.cc/home/common/visitfile/sign/76283ca8a61b7a9be3786a29150112a1?showdoc=.jpg" alt="" /></p>
<p>把sql复制
<img src="https://www.showdoc.cc/home/common/visitfile/sign/ca72c72333ca34ff014df40d8dc6b547?showdoc=.jpg" alt="" /></p>
<p>然后取消要新建的表 点下一步</p>
<p><img src="https://www.showdoc.cc/home/common/visitfile/sign/cab390c93c863783fba4a071acdca821?showdoc=.jpg" alt="" /></p>
<p>把这三个表 sql复下来手动插入测试数据库。
CREATE TABLE "public"."g_gift" (
"id" int4 NOT NULL DEFAULT nextval('g_gift_id_seq'::regclass),
"companyid" varchar(30) COLLATE "pg_catalog"."default" NOT NULL DEFAULT NULL::character varying,
"c_mc" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
"m_buy" numeric(19,5) DEFAULT NULL::numeric,
"m_use" numeric(19,5) DEFAULT NULL::numeric,
"i_so" int4 DEFAULT NULL,
"i_num" int4 DEFAULT NULL,
"i_rtl" int4 DEFAULT NULL,
"i_pay" int4 DEFAULT NULL,
"d_sale_b" timestamp(6) DEFAULT NULL::timestamp without time zone,
"d_sale_e" timestamp(6) DEFAULT NULL::timestamp without time zone,
"d_pay_b" timestamp(6) DEFAULT NULL::timestamp without time zone,
"d_pay_e" timestamp(6) DEFAULT NULL::timestamp without time zone,
"c_zuangtm" char(1) COLLATE "pg_catalog"."default" DEFAULT NULL::bpchar,
"c_id" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
"d_id" timestamp(6) DEFAULT now(),
"c_upid" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
"d_upid" timestamp(6) DEFAULT now(),
CONSTRAINT "pk_g_gift" PRIMARY KEY ("id")
)
;</p>
<p>ALTER TABLE "public"."g_gift" OWNER TO "postgres";</p>
<p>CREATE TABLE "public"."g_giftmx" (
"id" int4 NOT NULL DEFAULT nextval('g_giftmx_id_seq'::regclass),
"giftid" int4 NOT NULL DEFAULT NULL,
"m_buy" numeric(19,5) DEFAULT NULL,
"m_use" numeric(19,5) DEFAULT NULL,
"i_so" int4 DEFAULT NULL,
"i_rtl" int4 DEFAULT 0,
"i_pay" int4 DEFAULT 0,
"d_pay" timestamp(6) DEFAULT NULL,
CONSTRAINT "pk_g_giftmx" PRIMARY KEY ("id")
)
;</p>
<p>ALTER TABLE "public"."g_giftmx" OWNER TO "postgres";</p>
<p>CREATE TABLE "public"."t_upload_file" (
"n_fileid" int8 NOT NULL DEFAULT nextval('t_oss_file_n_fileid_seq'::regclass),
"i_name" varchar(255) COLLATE "pg_catalog"."default" DEFAULT NULL,
"file_path" varchar(255) COLLATE "pg_catalog"."default" DEFAULT NULL,
"file_type" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL,
"d_upload" timestamp(6) NOT NULL DEFAULT now(),
"d_expired" date NOT NULL DEFAULT NULL,
"c_yonghbh" varchar(30) COLLATE "pg_catalog"."default" NOT NULL DEFAULT NULL,
CONSTRAINT "t_upload_file_pkey" PRIMARY KEY ("n_fileid")
)
;</p>
<p>ALTER TABLE "public"."t_upload_file" OWNER TO "postgres";</p>
<p>然后点运行</p>
<p><img src="https://www.showdoc.cc/home/common/visitfile/sign/13f6aa3b8e3db0d9f4c09ce9297fee7a?showdoc=.jpg" alt="" /></p>
<p>CREATE TABLE "public"."g_gift" (
"id" serial4 NOT NULL DEFAULT nextval('g_gift_id_seq'::regclass),
"companyid" varchar(30) COLLATE "pg_catalog"."default" NOT NULL DEFAULT NULL::character varying,
"c_mc" varchar(100) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
"m_buy" numeric(19,5) DEFAULT NULL::numeric,
"m_use" numeric(19,5) DEFAULT NULL::numeric,
"i_so" int4 DEFAULT NULL,
"i_num" int4 DEFAULT NULL,
"i_rtl" int4 DEFAULT NULL,
"i_pay" int4 DEFAULT NULL,
"d_sale_b" timestamp(6) DEFAULT NULL::timestamp without time zone,
"d_sale_e" timestamp(6) DEFAULT NULL::timestamp without time zone,
"d_pay_b" timestamp(6) DEFAULT NULL::timestamp without time zone,
"d_pay_e" timestamp(6) DEFAULT NULL::timestamp without time zone,
"c_zuangtm" char(1) COLLATE "pg_catalog"."default" DEFAULT NULL::bpchar,
"c_id" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
"d_id" timestamp(6) DEFAULT now(),
"c_upid" varchar(200) COLLATE "pg_catalog"."default" DEFAULT NULL::character varying,
"d_upid" timestamp(6) DEFAULT now(),
CONSTRAINT "pk_g_gift" PRIMARY KEY ("id")
)
;</p>
<p>ALTER TABLE "public"."g_gift" OWNER TO "postgres";</p>
<p>CREATE TABLE "public"."g_giftmx" (
"id" serial4 NOT NULL DEFAULT nextval('g_giftmx_id_seq'::regclass),
"giftid" int4 NOT NULL DEFAULT NULL,
"m_buy" numeric(19,5) DEFAULT NULL,
"m_use" numeric(19,5) DEFAULT NULL,
"i_so" int4 DEFAULT NULL,
"i_rtl" int4 DEFAULT 0,
"i_pay" int4 DEFAULT 0,
"d_pay" timestamp(6) DEFAULT NULL,
CONSTRAINT "pk_g_giftmx" PRIMARY KEY ("id")
)
;</p>
<p>ALTER TABLE "public"."g_giftmx" OWNER TO "postgres";</p>
<p>CREATE TABLE "public"."t_upload_file" (
"n_fileid" serial8 NOT NULL DEFAULT nextval('t_oss_file_n_fileid_seq'::regclass),
"i_name" varchar(255) COLLATE "pg_catalog"."default" DEFAULT NULL,
"file_path" varchar(255) COLLATE "pg_catalog"."default" DEFAULT NULL,
"file_type" varchar(20) COLLATE "pg_catalog"."default" DEFAULT NULL,
"d_upload" timestamp(6) NOT NULL DEFAULT now(),
"d_expired" date NOT NULL DEFAULT NULL,
"c_yonghbh" varchar(30) COLLATE "pg_catalog"."default" NOT NULL DEFAULT NULL,
CONSTRAINT "t_upload_file_pkey" PRIMARY KEY ("n_fileid")
)
;</p>
<p>ALTER TABLE "public"."t_upload_file" OWNER TO "postgres";</p>
<p>统一2.0以上版本商品图片保存的表名;不从g_image取值;执行以下sql</p>
<pre><code> update g_spdmimg set imgname=a.c_name,goods_image=a.c_id,imgmd5=a.c_beiz from g_image a where g_spdmimg.imageid=a.imageid;
update g_vipimg set imgname=a.c_name,goods_image=a.c_id,imgmd5=a.c_beiz from g_image a where g_vipimg.imageid=a.imageid;
</code></pre>
<p>执行 share2.0\sql\20171222.sql --语句执行注意事项,已经写在脚本中了,特别注意 g_vip 表的字段修改,因为这个表行数非常大</p>
<p>sql特别多 表不存在的不用执行</p>
<p>配置maindb数据库连接方式
用navicat登陆开发测试用的maindb数据库</p>
<h1>待补充</h1>