Parker Jones wrote:
Hello,
I have to move my wiki installation several times a year and it's always a laborious,
time-consuming admin task.
http://www.mediawiki.org/wiki/Manual:Moving_a_wiki
I was wondering if there were any plans to make it easier? Would it be possible to
develop a script or admin functionality to automate the task - saying breaking it into
just two steps: "Export entire wiki" and "Import wiki". It would
backup/restore the database, copy any additional files LocalSettings, (uploaded images
etc), ...
It's easy to do, but each sysadmin will have different needs and will
thus need different scripts.
Supposing the server location and db don't change between servers (eg.
it is always on /wiki and localhost database with same user) it could be
like this:
backup-wiki.sh
mysqldump -u $USER --password=$PASSWORD $DATABASE -c > backup.sql || exit 1
bzip2 backup.sql || exit 1
tar cjf backup.tbz backup.sql.bz2 LocalSettings.php images/ math/ ||
exit 1
# Alternatively, tar the whole mediawiki folder
unbackup-wiki.sh
# Unpack the backup on the latest mediawiki
MW_VER=1.15.3
wget
http://download.wikimedia.org/mediawiki/`echo $MW_VER | sed
"s/\([0-9]*\.[0-9]*\).*/\1/"`/mediawiki-$MW_VER.tar.gz -O mediawiki.tgz
|| exit 1
tar xzf mediawiki.tgz || exit 1
cd mediawiki-* && mv * .. && cd .. && rmdir mediawiki-* || exit 1
tar xjf backup.tbz || exit 1
php5 maintenance/update.php || exit 1
Another problem I encounter is that one platform has
an older version of mediawiki and the new platform has a newer version - but to move the
wiki there's no way around installing two versions on one of the servers. Am I
missing something?
Moving to an older wiki is not supported. You could install two
mediawiki versions side by side, each with its own database but what you
neeed is to update if you are moving to a server with an *older*
mediawiki (moving to a newer mediawiki is not a problem, just run
update.php, see the above sample)