[Mediawiki-l] Using export/import instead of upgrading

Sean McAfee smcafee at collaborativefusion.com
Fri Oct 24 11:05:20 UTC 2008


Frames Project wrote:
 > Hello
 >
 > I would like to know why, instead of upgrading from a very old Mediawiki
 > version the following procedure is not possible :

You can but with just a dump/restore, at the very least, you'll lose 
user accounts (I'm not entirely sure how that works for images either).

Restoring everything - including accounts and preferences - is possible 
if you're not afraid of databases.  I used the following procedure to do 
a complete dump & rebuild (including users) on my PostgreSQL-based install:

1. Dump content (dumpBackup.php --full)
2. Populate database on new install via config/
3. Replace the generated LocalSettings.php
4. Run importDump.php
5. Export some tables:
pg_dump mediawiki.image -a > mediawiki.image.dump
pg_dump mediawiki.oldimage -a > mediawiki.oldimage.dump
pg_dump mediawiki.mwuser -a > mediawiki.mwuser.dump
pg_dump mediawiki.recentchanges -a > mediawiki.recentchanges.dump
pg_dump mediawiki.user_groups -a > mediawiki.user_groups.dump
pg_dump mediawiki.interwiki -a > mediawiki.interwiki.dump (NOTE: I only 
dumped this because we use custom IW prefixes)
pg_dump mediawiki.watchlist -a > mediawiki.watchlist.dump
pg_dump mediawiki.pagecontent -a > mediawiki.pagecontent.dump

6. Reimport in the required order:
TRUNCATE mediawiki.pagecontent;
\i mediawiki.pagecontent.dump
TRUNCATE mediawiki.mwuser cascade;
\i mediawiki.mwuser.dump
\i mediawiki.user_groups.dump
TRUNCATE mediawiki.image cascade;
TRUNCATE mediawiki.oldimage cascade;
\i mediawiki.image.dump
\i mediawiki.oldimage.dump
\i mediawiki.recentchanges.dump
\i mediawiki.interwiki.dump
\i mediawiki.watchlist.dump

YMMV, but the only problem I've encountered so far was a screwed up 
sequence in the user IDs that was fixed with an ALTER SEQUENCE ... 
RESTART. 

As a disclaimer, there could be plenty of other things that may go wrong 
with this procedure as it relates the DB dumps/restores.  We're 
fortunate enough to have staff that could debug and fix any of these 
problems should they come up.  I really wouldn't recommend doing 
anything beyond Step 4 if you (or your company/organization) don't have 
the experience and PHP/SQL knowledge to do serious debugging and fixing.

-- 
Sean McAfee
System Engineer

Collaborative Fusion, Inc.
 smcafee at collaborativefusion.com
 412-422-3463 x 4025

5849 Forbes Avenue
Pittsburgh, PA 15217

****************************************************************
IMPORTANT: This message contains confidential information
and is intended only for the individual named. If the reader of
this message is not an intended recipient (or the individual
responsible for the delivery of this message to an intended
recipient), please be advised that any re-use, dissemination,
distribution or copying of this message is prohibited. Please
notify the sender immediately by e-mail if you have received
this e-mail by mistake and delete this e-mail from your system.
E-mail transmission cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses. The
sender therefore does not accept liability for any errors or
omissions in the contents of this message, which arise as a
result of e-mail transmission.
****************************************************************




IMPORTANT: This message contains confidential information and is intended only for the individual named. If the reader of this message is not an intended recipient (or the individual responsible for the delivery of this message to an intended recipient), please be advised that any re-use, dissemination, distribution or copying of this message is prohibited. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.





More information about the MediaWiki-l mailing list