Ajuda:Importació
| Nota: Quan modifiqueu aquesta pàgina, esteu acceptant que la vostra contribució es publiqui en el marc de CC0. Vegeu Pàgines d'ajuda de domini públic per a més informació. |
La importació fa referència al procés de portar pàgines d'un wiki a un altre.
La importació de pàgines pot ser una eina poderosa que pot fer coses inesperades i perilloses fàcilment al vostre wiki. Només importeu contingut d'aquesta manera si sabeu què esteu fent.
Hi ha dos tipus d'importació, tots dos accessibles a través de la pàgina Special:Import, la importació Transwiki i la importació Upload.
Tipus d'importació
Importació transwiki
Transwiki import, also known as interwiki import, lets you import pages from one wiki to another.
The settings of the destination wiki decide which source wikis are allowed.
MediaWiki:import-interwiki-text (Seleccioneu un wiki i un títol de pàgina per importar.
Es conservaran les dates de les revisions i els noms dels editors.
Totes les importacions d'altres wikis s'emmagatzemen al registre d'importacions.) might appear during the process.
Transwiki import is equivalent to going to Special:Export on the source wiki, downloading the resulting XML file, and then importing it using XML import, except that you might only have permissions to do one but not the other.
When transwiki importing, the Inclou totes les plantilles i pàgines transcloses option imports all the templates used an imported page.
This is not necessarily all templates the page depends on to run (if you import a template and its dependencies, it does not include any subtemplates unless they happen to be transcluded with the base template page itself). This option can easily import more pages than you intended, should generally only be checked if you really know what you are doing, as it can screw up the wiki in ways that take a lot of effort to undo.
To check if your wiki has Transwiki import sources configured and see which wikis they apply to, you can use the API:
- <wiki url>/w/api.php?action=paraminfo&modules=import
The configuration is specified as: <param name="interwikisource" description="For interwiki imports: wiki to import from"> …
Upload import
See also: Manual:Importing XML dumps
Upload Import, lets you import an XML file generated by exporting pages from another wiki. This displays the message MediaWiki:Importtext (Exporteu el fitxer des del wiki d'origen utilitzant l'eina d'exportació. Deseu-lo al vostre dispositiu i carregueu-ne una còpia ací.)
To export wiki pages to a file, see Ajuda:Exportació.
Generally, any user can export pages to a file, but importing them into a wiki requires the importupload user right.
This is granted to sysops in the default configuration, but on WMF wikis is its own "importer" group.
Unlike with transwiki import, which always preserves content from the source wiki unchanged, nothing stops you from editing the XML file before importing it, allowing backdating of edits, fake usernames, or other ways of rewriting history.
This editing process can be used for:
- Adding a note about the import in the edit summary or as a change tag.
- Changing user names and page names to avoid conflicts.
- Adjusting namespace names to be more generic or suitable
- Rebasing edits, as an alternative to revision deletion of large chunks of history if unacceptable content is added and later removed.
See Manual:XML Import file manipulation in CSharp for an example of handling these XML files using C# in Visual Studio .NET.
Useful applications of importing
- Keeping the page history intact when moving and editing a page in a different wiki. This is particularly helpful if the source page becomes harder to locate due to page moves.
- Preserving the history when a page is moved to another wiki and then deleted from the original wiki.
- Using templates from another wiki.
Usernames
The default behavior
By default, imported edits appear with an interwiki prefix, like meta>Example.
See an example of an imported history here.
Assigning edits to local users
If you tick the Assigna modificacions a usuaris locals allà on l'usuari en concret existeix localment checkbox, then edits will be attributed to the user with no interwiki prefix if such a user exists.
This makes it not easily possible to distinguish between imported edits and edits originally made on the wiki.
IP edits
IP addresses stay the same and if you apply the ip tag next to a reserved username, it will work too.
Recent changes
Imported edits never show up in recent changes, but the act of performing the import itself does.
Import destinations
By default, imported edits appear in the same namespace and title on the target wiki as they did in the source wiki. The import form allows you to specify the following:
- A namespace to import content to instead (Importa a un espai de noms:). The namespace option completely ignores the source wiki namespace, so if you import m:Template:Void into Help space it will become Help:Void, not Help:Template:Void.
- A base page to make all imported pages subpages of (Importa com a subpàgines de la pàgina següent:).