[discuz建站技术]
Discuz ! X3.4,老旧帖子本地转到远程与远程转到本地的方法!
[复制链接]
|
一、本地转到远程
+ B4 X. @! {7 _# D+ N: G+ F# S( H4 U( e, m. z
1、论坛后台–全局–上传设置–启用远程附件: o) K; q- z. y
/ L3 v3 Q9 N# f% [, P. s( H9 u+ E# O2、将本地附件目录data/attachment里面的文件夹移动到远程服务器上
0 u* I+ }" I' g5 o& I: H5 u2 H6 a- w" Q- w
3、数据库执行sql语句% Z2 I1 k& ^! J0 @+ A* Z/ b
7 I( s& V. k3 \3 [: \- C8 f论坛的
^9 u. V5 z) _) H9 ?
! r# C: k3 `( p0 k* n4 F(where remote=0表示本地,where remote=1表示远程, pre_表示数据库表前缀)- update pre_forum_attachment_0 set remote=1 where remote=0;
- update pre_forum_attachment_1 set remote=1 where remote=0;
- update pre_forum_attachment_2 set remote=1 where remote=0;
- update pre_forum_attachment_3 set remote=1 where remote=0;
- update pre_forum_attachment_4 set remote=1 where remote=0;
- update pre_forum_attachment_5 set remote=1 where remote=0;
- update pre_forum_attachment_6 set remote=1 where remote=0;
- update pre_forum_attachment_7 set remote=1 where remote=0;
- update pre_forum_attachment_8 set remote=1 where remote=0;
- update pre_forum_attachment_9 set remote=1 where remote=0;
复制代码 门户的- update pre_portal_article_title set remote=1 where remote=0;
- update pre_portal_attachment set remote=1 where remote=0;
- update pre_portal_topic_pic set remote=1 where remote=0;
复制代码 相册的
# r# V" ~* M1 L6 u8 q" _) m1 x7 J' @& } Q0 H9 W; r, }
{相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)}- update pre_home_pic set remote=remote+1;
复制代码 二、远程转到本地8 J9 |; \6 ~ j4 E z
" _- e. [+ y' u/ n& z0 Z
后台关闭远程附件设置,将附件移动到本地服务器的 data/attachment目录后执行sql即可4 v3 s8 z; D# k e% E0 j+ ^
/ H& e0 g4 v3 M m, W, @% W) g$ v. W(where remote=0表示本地,where remote=1表示远程, pre_表示数据库表前缀)(已包括论坛、门户与相册)- update pre_forum_attachment_0 set remote=0 where remote=1;
- update pre_forum_attachment_1 set remote=0 where remote=1;
- update pre_forum_attachment_2 set remote=0 where remote=1;
- update pre_forum_attachment_3 set remote=0 where remote=1;
- update pre_forum_attachment_4 set remote=0 where remote=1;
- update pre_forum_attachment_5 set remote=0 where remote=1;
- update pre_forum_attachment_6 set remote=0 where remote=1;
- update pre_forum_attachment_7 set remote=0 where remote=1;
- update pre_forum_attachment_8 set remote=0 where remote=1;
- update pre_forum_attachment_9 set remote=0 where remote=1;
- update pre_portal_article_title set remote=0 where remote=1;
- update pre_portal_attachment set remote=0 where remote=1;
- update pre_portal_topic_pic set remote=0 where remote=1;
- update pre_home_pic set remote=remote-1;
复制代码
+ z( i/ P1 i, x2 `6 O$ r$ A- J$ T |
|