Discuz论坛本地附件与远程附件的转换方法,详细步骤如下:4 v4 {* j6 d" ^) t& K" [/ N5 q
7 q6 M8 e+ p, m
一、后台--全局--上传设置--远程附件--启用远程附件:是4 h' z& _" v+ E2 O" U& B; u& @
4 m2 s. l' d+ x- L5 [
这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。
! H& e# r% V) b. A二、上传data/attachment下面的文件夹到远程空间的根目录下9 p& Y0 D+ Z. \6 m7 G h
& A s8 g& e; ^3 N0 w4 h
三。转换数据库的本地附件的数据为远程附件数据
$ m; Q/ o" X0 C( e: E涉及到的数据库表:
1 v9 Z3 n) d- @8 f# A$ p) V; upre_forum_attachment+ u9 z0 r3 B$ P+ k0 W( y
pre_home_pic! `! a" n& R3 b; P' U
pre_portal_article_title
: R3 C. A% t8 D5 l8 Hpre_portal_attachment
8 D! c4 h7 _* R' z( lpre_portal_topic_pic
6 r$ d0 f) L9 o: Y, X6 M在后台--站长--数据库--升级--分别执行如下代码
+ q% q$ v3 A7 v& |2 m1、pre_forum_attachment
" F, c1 D8 x& L+ f5 B3 X' X- update pre_forum_attachment_0 set remote = '1';9 l3 o9 Y, E! i% o8 u' P
- update pre_forum_attachment_1 set remote = '1';
7 t; ^& D5 P8 B0 I& E - update pre_forum_attachment_2 set remote = '1';
+ }% W. c2 k; a$ f; S' K - update pre_forum_attachment_3 set remote = '1';' b; }6 q0 m7 D: X( ~1 R
- update pre_forum_attachment_4 set remote = '1';- o: Y5 p# J% N7 D N
- update pre_forum_attachment_5 set remote = '1';$ ~! G" e: ]1 d
- update pre_forum_attachment_6 set remote = '1';. o5 u9 {1 J% ]- h. u
- update pre_forum_attachment_7 set remote = '1';' U7 n% c* F' A/ S; z( I1 ^0 u* |
- update pre_forum_attachment_8 set remote = '1'; X( j. i) V7 R# ]9 D+ E* y0 C1 x
- update pre_forum_attachment_9 set remote = '1';
复制代码 2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic' {3 }# ~$ W; V1 f/ ^
- update pre_portal_article_title set remote=1;
" h. `' r1 q- _& \) B& V. G0 Y - update pre_portal_attachment set remote=1;0 J8 F7 G5 f. a: i- B
- update pre_portal_topic_pic set remote=1;
复制代码 3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句:
+ L. H5 X$ q, s- update pre_home_pic set remote=remote+1;
复制代码 稳定互联提示:按照以上操作后,打开网站附件 - 属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz本地附件成功转换为远程附件了。 d' O% T6 o. O7 O `! {- |
|