Discuz论坛本地附件与远程附件的转换方法,详细步骤如下:
! a" M% i' m" Q * d! l% B. J1 k9 B6 ^2 E; b
一、后台--全局--上传设置--远程附件--启用远程附件:是
5 D8 F/ ~' p$ }. _) S0 z! R2 l( L
4 E0 w4 X) Z4 x% k$ G
这里根据后台提示和自己开启的远程服务器的FTP的信息配置就可以,要确保FTP具有以下权限:读取文件、写入文件、删除文件、创建目录、子目录继承。
/ k: }; \# g' ?二、上传data/attachment下面的文件夹到远程空间的根目录下
, j4 B' l: T* a. F$ p' ?% w9 j3 |; U1 n( c, E L- ]1 v- k
三。转换数据库的本地附件的数据为远程附件数据6 r% i7 m" d3 u# d
涉及到的数据库表:7 q* h6 e9 i- {! z$ {# P ~
pre_forum_attachment7 s0 X) t8 ^# e$ q, V& }! u- ]3 q9 _
pre_home_pic m ^1 N9 o1 o
pre_portal_article_title. m0 ^' ?" ?& q$ H
pre_portal_attachment7 C# _! ^ x) |5 p* L/ i- V
pre_portal_topic_pic
( k3 `/ L4 ?) n [( |% ^8 E在后台--站长--数据库--升级--分别执行如下代码, L) m4 s, M! ]; q( e5 }' V9 u0 c
1、pre_forum_attachment
7 C/ a' C- l, w4 y, o! R- update pre_forum_attachment_0 set remote = '1';
1 m7 d* m6 h' Q1 v2 g - update pre_forum_attachment_1 set remote = '1';$ \ \$ U' \( _# z( Z5 d# y( T! |
- update pre_forum_attachment_2 set remote = '1';7 K% T$ Y, W6 Y; y
- update pre_forum_attachment_3 set remote = '1';! s+ L6 @5 L, C" W
- update pre_forum_attachment_4 set remote = '1';; F4 l8 @* K' c, w4 O) N& M
- update pre_forum_attachment_5 set remote = '1'; {* }9 C' N, R" n7 w! f4 p
- update pre_forum_attachment_6 set remote = '1';2 W: x9 ?5 [' O0 S0 ` Q' e1 e& c/ K. f
- update pre_forum_attachment_7 set remote = '1';
2 r2 b) h" e1 h - update pre_forum_attachment_8 set remote = '1';0 i, x5 @$ q4 D% ]4 U
- update pre_forum_attachment_9 set remote = '1';
复制代码 2、pre_portal_article_title,pre_portal_attachment,pre_portal_topic_pic
/ ] v1 [0 |! I" f- update pre_portal_article_title set remote=1;- K5 s$ q* k+ G# {
- update pre_portal_attachment set remote=1;
) y4 F% G. K( G - update pre_portal_topic_pic set remote=1;
复制代码 3、由于相册表中的remote取值还有一种情况为remote=2(论坛附件图片保存到相册)pre_home_pic,执行语句:
+ B6 |: j7 B' f" t/ V% A- update pre_home_pic set remote=remote+1;
复制代码 稳定互联提示:按照以上操作后,打开网站附件 - 属性看看是否已经在远程地址上了,如果显示正常说明就已经把Discuz本地附件成功转换为远程附件了。
1 i/ n6 J9 u5 b/ {- Y |