Discuz论坛本地附件与远程附件的转换方法,详细步骤如下:
8 f }9 Z; r+ I# A R % G% Y' @$ Y( a7 O
一、后台--全局--上传设置--远程附件--启用远程附件:是
3 E& W4 }/ J! K) C$ C
Z6 K4 Y: v5 c# M4 [
这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。- W) @7 ^- D# z M' O2 w- O
二、上传data/attachment下面的文件夹到远程空间的根目录下7 S4 w* E9 y7 S9 j
# `, g5 z- [5 E! e& r. W; m- O+ |三。转换数据库的本地附件的数据为远程附件数据6 ?% z/ L/ v4 |' J/ T# L8 f l+ X
涉及到的数据库表:
2 y- ]6 a5 W' i5 @pre_forum_attachment! J& x* `: @' j3 n% [
pre_home_pic2 ~# g0 {3 y! a+ n/ B4 {0 r% l
pre_portal_article_title; V* X1 V6 J e" X; r# g
pre_portal_attachment
+ l6 `% b$ P4 E+ M# p& R9 ?pre_portal_topic_pic
- Y% @& @ c9 B8 D7 X* K. e, q在后台--站长--数据库--升级--分别执行如下代码
+ c* y$ u) S3 f. s" [# X2 I* E1、pre_forum_attachment
+ L# s2 `2 w; W( ^. X/ t% O; H1 H. D- update pre_forum_attachment_0 set remote = '1';
& O% d; I& u( E4 Q9 n. F - update pre_forum_attachment_1 set remote = '1';
( u: k' d0 w7 J5 u; b3 R) w# E - update pre_forum_attachment_2 set remote = '1';8 M; f& u9 s D! R' b( [: _
- update pre_forum_attachment_3 set remote = '1';+ j, r/ e2 V( D# T% |/ P4 S. I. T
- update pre_forum_attachment_4 set remote = '1';
3 S z1 F; I0 z3 @/ o' t. v - update pre_forum_attachment_5 set remote = '1';
7 Q6 l. z, v, h" |$ n! g - update pre_forum_attachment_6 set remote = '1';) l$ w& B& x( z# T
- update pre_forum_attachment_7 set remote = '1';( F f! `: ]; y
- update pre_forum_attachment_8 set remote = '1';9 Y& D; v4 e9 D: z$ v: h4 J
- update pre_forum_attachment_9 set remote = '1';
复制代码 2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic
8 g: U" n# N4 G/ p/ Y; h- K" ^& |- update pre_portal_article_title set remote=1;8 g2 T) e c6 d i
- update pre_portal_attachment set remote=1;/ ~ Q' r% l N( m, ?1 o
- update pre_portal_topic_pic set remote=1;
复制代码 3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句:% \9 Z( B1 Q3 V5 b4 q2 n
- update pre_home_pic set remote=remote+1;
复制代码 稳定互联提示:按照以上操作后,打开网站附件 - 属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz本地附件成功转换为远程附件了。
& R- H$ k+ t& F0 c6 i! } |