Discuz论坛本地附件与远程附件的转换方法,详细步骤如下:1 |7 C& g- Q! L! O \; Y
* \* X+ y0 [: W+ o+ N
一、后台--全局--上传设置--远程附件--启用远程附件:是9 {" a4 ~/ _8 m/ y5 I- ` F0 r1 i
7 B6 d3 q2 _% i% ?" F
这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。
6 H/ [" `' v/ I- n# ?+ o二、上传data/attachment下面的文件夹到远程空间的根目录下 i I% }, A% `0 S
4 i6 a. W& [; u$ R! L7 j
三。转换数据库的本地附件的数据为远程附件数据" W* T8 b2 a; @
涉及到的数据库表:
. k! v6 A- n* ~/ u7 X+ i. G1 m) Upre_forum_attachment f2 C* W, q$ m% ^& f
pre_home_pic- s) z5 h- s9 j }- Z( a
pre_portal_article_title9 K5 ?2 M; C& K4 X1 l% f
pre_portal_attachment/ f1 w3 }: m3 J9 @* @3 G
pre_portal_topic_pic2 c' y; o- U, h8 n+ z m
在后台--站长--数据库--升级--分别执行如下代码
6 d# g4 N2 ^7 Q+ j) u- l1、pre_forum_attachment& o& X* K. A$ P; U0 l s: ~1 z
- update pre_forum_attachment_0 set remote = '1';9 s& ?4 k% r0 X6 w6 F9 M
- update pre_forum_attachment_1 set remote = '1';* d# A( J2 t9 g# g, f
- update pre_forum_attachment_2 set remote = '1';8 H& f" w, i8 [' p+ R2 f
- update pre_forum_attachment_3 set remote = '1';4 ? @' |+ m b, _. P2 y5 G: e. ]
- update pre_forum_attachment_4 set remote = '1';
, U% ^( j; O8 J1 j/ @ - update pre_forum_attachment_5 set remote = '1';
% U0 r# f+ j2 q' y5 p - update pre_forum_attachment_6 set remote = '1';
" f8 x. b/ ?/ p3 b: X - update pre_forum_attachment_7 set remote = '1';+ s; P' N1 q5 O u# i) f6 }/ F- L
- update pre_forum_attachment_8 set remote = '1';8 i& R; V& j4 e
- update pre_forum_attachment_9 set remote = '1';
复制代码 2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic2 H& n7 \7 _$ W8 _
- update pre_portal_article_title set remote=1;
2 D5 h* ?6 A! _" g$ I# b2 V - update pre_portal_attachment set remote=1;9 H) v6 [3 ]6 p0 j
- update pre_portal_topic_pic set remote=1;
复制代码 3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句:! T. M; g8 Y) @ h% O' i' ~/ }- [
- update pre_home_pic set remote=remote+1;
复制代码 稳定互联提示:按照以上操作后,打开网站附件 - 属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz本地附件成功转换为远程附件了。' l$ z& f- [% s$ o% f- R) `( ]
|