Commit 891d73f3 authored by Jesper Zedlitz's avatar Jesper Zedlitz
Browse files

nur images Tabelle von wiki-commons übernehmen

parent b50574fd
......@@ -15,9 +15,6 @@ zcat /root/wiki_de.sql.gz | mysql -h $IP -u wiki_de -pgwLfmlNrZm8Rs wiki_de
# dauert ca. 30 Minuten
cat /root/genwiki/clean.sql | mysql -h $IP -u wiki_de -pgwLfmlNrZm8Rs wiki_de
echo "select max(page_id) from page;" | mysql -h $IP -u wiki_de -pgwLfmlNrZm8Rs wiki_de
echo "select max(old_id) from text;" | mysql -h $IP -u wiki_de -pgwLfmlNrZm8Rs wiki_de
echo "select max(rev_id) from revision;" | mysql -h $IP -u wiki_de -pgwLfmlNrZm8Rs wiki_de
```
## Vorbereiten der wiki-commons Datenbank
......@@ -33,40 +30,13 @@ zcat /root/wiki_commons.sql.gz| mysql -h $DB -pvdlefZLigejn6 wiki_commons
# dauert etwa 1 Minute
```
Die oben ausgegebenen drei Zahlen für `page_id`, `old_id` und `rev_id` müssen nun in diesen SQL-Statements angepasst werden:
```sql
start transaction;
update revision set rev_page=rev_page+492146;
update page set page_id = page_id + 492146;
update archive set ar_page_id = ar_page_id + 492146;
update revision set rev_id=rev_id + 2136211;
update archive set ar_rev_id = ar_rev_id + 2136211;
update revision set rev_text_id = rev_text_id + 2062167;
update text set old_id = old_id + 2062167;
update archive set ar_text_id = ar_text_id + 2062167;
commit;
```
Diese SQL-Anweisungen in der `wiki_commons` Datenbank ausführen und dann die Inhalte in Dateien schreiben:
```bash
mysql -h $DB -pvdlefZLigejn6 wiki_commons
mysqldump -t -w "page_namespace=6" -h $DB -pvdlefZLigejn6 wiki_commons page > page.sql
mysqldump -t -h $DB -pvdlefZLigejn6 wiki_commons image > image.sql
mysqldump -t -h $DB -pvdlefZLigejn6 wiki_commons text > text.sql
mysqldump -t -h $DB -pvdlefZLigejn6 wiki_commons revision > revision.sql
mysqldump -t -h $DB -pvdlefZLigejn6 wiki_commons archive > archive.sql
cat page.sql image.sql text.sql revision.sql archive.sql | mysql -h $IP -u wiki_de -pgwLfmlNrZm8Rs wiki_de
# zur Sicherheit nochmal bereinigen, damit aus wiki_commons keine ins Leere laufenden Verweise hereingekommen sind
cat /root/genwiki/clean.sql | mysql -h $IP -u wiki_de -pgwLfmlNrZm8Rs wiki_de
mysql -h $IP -u wiki_de -pgwLfmlNrZm8Rs wiki_de < image.sql
```
## Durchführen des MediaWiki-Updates
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment