Jump to content
MediaWiki

Manual:Traslladar un wiki

From mediawiki.org
This page is a translated version of the page Manual:Moving a wiki and the translation is 31% complete.
Si voleu simplement traslladar el vostre wiki, per exemple, de /var/www/html/ a /var/www/html/mywiki/, les instruccions són aquí.

Aquesta pàgina explica com moure un wiki a un altre servidor. Sovint això és necessari quan es mou a un servidor web o domini diferent (o tots dos).

La manera més segura de fer-ho és utilitzant la mateixa versió de MediaWiki en tots dos wikis. Tanmateix, és possible instal·lar una versió més recent de MediaWiki al servidor nou i realitzar una actualització directament al servidor nou. De fet, aquesta pot ser la vostra única opció si voleu actualitzar el vostre wiki a una nova versió que tingui requisits més alts que els disponibles al vostre servidor antic (com la versió php).

Els passos s'expliquen bàsicament en altres pàgines:

  1. Feu una còpia de seguretat del vostre wiki.
  2. Transferiu les còpies de seguretat del servidor antic al nou.
  3. Restaureu la còpia de seguretat al servidor nou.
Abans de començar a fer una còpia de seguretat del vostre wiki, és possible que vulgueu posar-lo en mode de "només lectura" perquè ningú no el pugui editar mentre el moveu. Si no ho feu, podríeu perdre les edicions/càrregues/registres, etc. que es van fer durant el procés de migració. Per fer-ho, utilitzeu $wgReadOnly a LocalSettings.php. Per exemple:
$wgReadOnly = 'Down for maintenance: access will be restored shortly';

Actualitzar el servidor nou

If you are upgrading to a newer MediaWiki version on the new server, instead of copying the old MediaWiki directory and extensions to the new server, you should follow the upgrading procedure. You'll download a new MediaWiki version on the new server and fresh versions of the extensions you use, matching the new MediaWiki version. Remember to run the update script.

Notes

  • If the URL has changed (for example, a new domain), be sure to update all references to it in LocalSettings.php. If using VisualEditor, you'll need to update Parsoid configuration too.
    • Links on cached pages may still point to the old domain. You may need to bump $wgCacheEpoch to discard cached pages prior to that time.
  • Check that the upload/ directory has the correct permissions set if using uploads; it must be writable by the web server.
  • Make sure any extension directories have the correct permissions as well (e.g., if linux: chmod -R o=rx extensions)
  • When manually transferring a wiki from a windows platform to a Linux platform the best method is to:
  1. Manually install MediaWiki on the Linux platform from a tar file as outlined here: Manual Install of Wiki (i.e., try not to use install from an automated package)
  2. Replace the newly installed MediaWiki folder (e.g., /var/www/mediawiki...) on your Linux machine with the MediaWiki base folder from your windows machine
  3. Update your Linux machine's MySQL Database (e.g. wikidb) with the wiki database from your windows machine (i.e., use the backup and restore features of mysql as outlined above)
  • After importing a wiki database, even if the database can work, some minor problems may arise:
  1. You might need to repair Searchindex: In phpMyAdmin, enter "REPAIR TABLE wikidb.searchindex; " for rebuilding the search index. wikidb is your database's name.
  2. The collation of some rows may be changed. Cross-check it with the original database.

Test

At this point, try to use the wiki on the new server. Log in as a sysop and a regular user and check that viewing, creating and editing pages and uploading files still works. Fix any problems reported either by PHP or MediaWiki itself.

You can do the entire process to test if the move will work without problems, before actually putting the old wiki in read-only mode. Once you know your wiki in the new server works as expected, you can put your old wiki in read-only mode and perform the move again.

Problemes freqüents

Inaccessible files after changing the domain

The column md_deps in the module_deps table contains absolute file paths, which are used to locate the images and LESS files that CSS depends on. These paths break when the wiki is, e.g., moved to another folder or another server. After your move, you might see PHP warnings that certain files could not be accessed. In current versions of MediaWiki, this can be solved by running update.php , thus clearing caches.

In versions older than MediaWiki 1.25 (where phabricator:T37472 is not implemented), update.php does not delete the contents of the module_deps table. For these versions, the workaround is to manually fix wrong entries in the module_deps table:

-- Update entries in module_deps table
SET@old='wiki.old-domain.org';
SET@new='wiki.new-domain.org';
UPDATE`module_deps`SET`md_deps`=REPLACE(`md_deps`,@old,@new);

This can be used to update wrong path segments and to fix the error.

A similar issue can happen when MediaWiki tries to read resource loader messages. In this case the solution is to truncate the according tables:

-- Truncate message related caches
TRUNCATETABLE`msg_resource`;
TRUNCATETABLE`msg_resource_links`;

See also

Enllaços externs

AltStyle によって変換されたページ (->オリジナル) /