Migration des wikis

De Wicri Base 1.28
Révision datée du 16 juin 2017 à 18:19 par imported>Jacques Ducloy (Suite à améliorer)

Cette page est un recueil de notes pour la migration des wikis.

Variables shell

WIKI=http://ticri.univ-lorraine.fr/wicri-base.de
WIKI=http://ticri.univ-lorraine.fr/wicri.de
WIKI=http://ticri.univ-lorraine.fr/wicri-europa.de
WIKI=http://ticri.univ-lorraine.fr/wicri-base.pt
WIKI_TARGET=https://lorexplor.istex.fr/Wicri/Europe/de

WIKI=http://ticri.univ-lorraine.fr/wicri-music.en
WIKI_TARGET=https://lorexplor.istex.fr/Wicri/Musique/en

WIKI=http://ticri.univ-lorraine.fr/wicri-meta.en
WIKI_TARGET=https://lorexplor.istex.fr/Wicri/Meta/en

WIKI=http://ticri.univ-lorraine.fr/wicri-saarland.de
WIKI_TARGET=https://lorexplor.istex.fr/Wicri/Europe/Allemagne/Sarre/de

WIKI=http://ticri.univ-lorraine.fr/wicri-morocco.en
WIKI_TARGET=https://lorexplor.istex.fr/Wicri/Afrique/Maroc/en

WIKI=http://ticri.univ-lorraine.fr/wicri-gr.de
WIKI_TARGET=https://lorexplor.istex.fr/Wicri/Europe/GrandeRegion/de

WIKI=http://ticri.univ-lorraine.fr/wicri-outils.fr
WIKI_TARGET=https://lorexplor.istex.fr/Wicri/Outils/fr

Vérifications

Pour obtenir la liste des espaces de nom.

curl "$WIKI/api.php?action=query&meta=siteinfo&siprop=namespaces&format=xml" | SxmlIndent
curl "$WIKI_TARGET/api.php?action=query&meta=siteinfo&siprop=namespaces&format=xml" | SxmlIndent

Pour obtenir la liste des pages de l'espace principal

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100" \
   2>/dev/null  |SxmlSelect -s api/query/allpages/p/attribute::title -p @s1

Les modèles

Pour les wikis anglais

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=500&apnamespace=10"  2>/dev/null  |SxmlSelect -s api/query/allpages/p/attribute::title -p @s1  | sort -u > templateOld

curl "$WIKI_TARGET/api.php?action=query&list=allpages&format=xml&aplimit=500&apnamespace=10"  2>/dev/null  |SxmlSelect -s api/query/allpages/p/attribute::title -p @s1  | sort -u > templateTarget

diff templateOld templateTarget | grep "<"

Pour les wikis français

(
curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=500&apnamespace=10"  2>/dev/null  |SxmlSelect -s api/query/allpages/p/attribute::title -p @s1  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=500&apfrom=L&apnamespace=10"  2>/dev/null  |SxmlSelect -s api/query/allpages/p/attribute::title -p @s1 
) | sort -u > templateOld

(
curl "$WIKI_TARGET/api.php?action=query&list=allpages&format=xml&aplimit=500&apnamespace=10"  2>/dev/null  |SxmlSelect -s api/query/allpages/p/attribute::title -p @s1  

curl "$WIKI_TARGET/api.php?action=query&list=allpages&format=xml&aplimit=500&apfrom=L&apnamespace=10"  2>/dev/null  |SxmlSelect -s api/query/allpages/p/attribute::title -p @s1 
) | sort -u > templateTarget

diff templateOld templateTarget | grep "<"

diff templateOld templateTarget | grep "<" | cut -b 2-

Les catégories

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=500&apnamespace=14"  2>/dev/null  |SxmlSelect -s api/query/allpages/p/attribute::title -p @s1  | sort -u > categoriesOld

curl "$WIKI_TARGET/api.php?action=query&list=allpages&format=xml&aplimit=500&apnamespace=14"  2>/dev/null  |SxmlSelect -s api/query/allpages/p/attribute::title -p @s1  | sort -u > categoriesTarget

diff categoriesOld categoriesTarget | grep "<"

diff categoriesOld categoriesTarget | grep "<" | cut -b 2-

Suite à améliorer

 

(
curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=1"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=2"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=3"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=4"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=5"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=8"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=9"  2>/dev/null  
) |SxmlSelect -s api/query/allpages/p/attribute::title -p @s1


(
curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=11"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=12"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=13"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=15"  2>/dev/null
)    |SxmlSelect -s api/query/allpages/p/attribute::title -p @s1


(

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=102"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=103"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=104"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=105"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=106"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=107"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=108"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=109"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=500"  2>/dev/null  

curl "$WIKI/api.php?action=query&list=allpages&format=xml&aplimit=100&apnamespace=501"  2>/dev/null  

) |SxmlSelect -s api/query/allpages/p/attribute::title -p @s1