Linux:MediaWiki迁移

来自WHY42

导出

# install dir
cd /home/webapp/wiki

php maintenance/dumpBackup.php --full --uploads > ~/wiki-backup.xml
tar -cipzf ~/wiki_images.tgz images/

安装新Wiki

可以安装最新版wiki,顺便可以从MySql迁移到Sqlite

cd newWiki
php maintenance/importDump.php ~/wiki-backup.xml
php maintenance/maintenance/rebuildrecentchanges.php

然后导入文件

mkdir temp
cd temp/
cp ~/wiki_images.tgz ./
tar -xzvf wiki_images.tgz
cd ../
mkdir tempimg
cp temp/images/*/*/* tempimg
php maintenance/importImages.php tempimg/

另外还要改一下目录权限:

chown -R apache.apache wiki
chmod 777 wiki/images


Ubuntu

apt-get install apache2
systemctl status apache2.service
apt install lrzsz
cd sites-available/
ln -s ../sites-available/riguz.com.conf ../sites-enabled/riguz.com.conf
systemctl restart apache2.service


apt install php
apt-get install libapache2-mod-php

a2ensite blog.riguz.com
service apache2 reload

apt-get install php php-sqlite3 php-xml php-mbstring php-gd

a2enmod rewrite

chown -R www-data riguz.com

注意: Mediawiki $wgLanguageCode = "zh-cn"; 会影响搜索结果。