标签:running pac something dia creat ping completed database fir
How to move mediawiki from ubuntu to wsl?
[wikifolder]
: where your wiki locate[wikidb]
: database wiki uses[wikidb_user]
: user of database[wikifolder]
: /var/www/html[wikidb]
: wikidb[wikidb_user]
: root[wikifolder]
: /var/www/html[wikidb]
: wikidb[wikidb_user]
: wikiuserOld mediawiki is in Server 1. We‘d like to back up it, then scp to Server 2, finally restore from it in Server 2.
$wgReadOnly = 'Dumping Database, Access will be restored shortly';
this can be removed as soon as the dump is completed.
mysqldump --default-character-set=binary -u root -p -h localhost --opt wikidb > wikidb-backup.sql
For more, See Mysqldump_from_the_command_line, and Back up in schedule
tar czpvf mediawiki-1.23.13-backup.tar.gz /var/www/html
On the server on which you are restoring MediaWiki, ensure you have
mkdir mediawiki_backup && cd mediawiki_backup/
cp /mnt/c/Users/chencanyi/Videos/wikidb-backup.sql ~/mediawiki_backup/ # or you can use scp
mysqladmin -u wikiuser -p drop wikidb
mysqladmin -u wikiuser -p create wikidb
mysql -u wikiuser -p wikidb < wikidb-backup.sql
php /var/www/html/maintenance/update.php
Assuming you are in Service 1.
scp ubuntu@Service1:~/mediawiki_backup/mediawiki-1.23.13-backup.tar.gz ~/mediawiki_backup/
cd ~/mediawiki_backup/
tar -xvzf mediawiki-1.23.13-backup.tar.gz
rm -fR [wikifolder]/
mv ./var/www/html [wikifolder]
sudo service apache2 restart
sudo service mysql restart
cd /var/www/html
vi LocalSettings.php
# Something like
## Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "wikidb";
$wgDBuser = "root";
$wgDBpassword = "***";
标签:running pac something dia creat ping completed database fir
原文地址:https://www.cnblogs.com/canyichen/p/11144926.html