Discuz论坛本地附件与远程附件的转换方法,详细步骤如下:8 P! I- r" h) B6 E# B. H J' l# U
4 F; p( T' O( p, h1 @( U! b一、后台--全局--上传设置--远程附件--启用远程附件:是
% P" T9 `& H [/ k
- d' O9 h9 H t: G+ G这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。" G' T: y7 r0 w' S1 H+ O( l
二、上传data/attachment下面的文件夹到远程空间的根目录下% k$ T/ G4 B' ?& D- e& {
$ E0 z h" s/ \3 N三。转换数据库的本地附件的数据为远程附件数据
; n! O4 M* U" o# x+ ]涉及到的数据库表:- S3 ~, q" D3 W
pre_forum_attachment0 B2 l, j9 S. \
pre_home_pic- ] Y5 {3 o! n Y+ v/ Q6 Y9 s
pre_portal_article_title
$ y5 F6 t' r3 P, ?: Ipre_portal_attachment$ x5 s* V2 R/ t+ z3 A
pre_portal_topic_pic
/ u6 S$ s9 t: B8 h% }6 Z2 ^在后台--站长--数据库--升级--分别执行如下代码4 O2 ^9 \0 r7 h9 E- V
1、pre_forum_attachment4 H- J$ `2 P& N
- update pre_forum_attachment_0 set remote = '1';7 D4 p3 Z! k- x( M' r3 K
- update pre_forum_attachment_1 set remote = '1';9 l3 t; n. I' a1 H" g/ C) S
- update pre_forum_attachment_2 set remote = '1';1 L$ T4 } K f% h: w
- update pre_forum_attachment_3 set remote = '1';
4 P9 x$ F+ ~4 E) F; ^# F - update pre_forum_attachment_4 set remote = '1';
* V( E8 v b; E% g( Y9 [ - update pre_forum_attachment_5 set remote = '1';6 }/ L, H# l7 _: H* ]
- update pre_forum_attachment_6 set remote = '1'; ]8 ?3 |+ n2 O5 o6 ]/ I G( p
- update pre_forum_attachment_7 set remote = '1';
2 m6 [$ u5 a/ a! i5 M. b3 Y' W - update pre_forum_attachment_8 set remote = '1';
$ g( q4 q! S/ f: u- e - update pre_forum_attachment_9 set remote = '1';
复制代码 2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic8 ~0 h, I1 k# j& E" \( i
- update pre_portal_article_title set remote=1;$ c% B# k) N$ m ?& X7 @
- update pre_portal_attachment set remote=1;
/ R, E& _' ~, U2 U7 _' R - update pre_portal_topic_pic set remote=1;
复制代码 3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句:8 o( v% f3 ^& k) U
- update pre_home_pic set remote=remote+1;
复制代码 稳定互联提示:按照以上操作后,打开网站附件 - 属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz本地附件成功转换为远程附件了。
) `& \" [1 g& o8 P! V |