Difference between revisions of "Restore.sh"
Jump to navigation
Jump to search
(Created page with "On a running instance of bkoo/MediaWiki:1.35, the following backup.sh script can be launched using the following instruction: <SyntaxHighlight> docker exec dockerizedwiki...") |
|||
Line 1: | Line 1: | ||
On a running instance of [[bkoo/MediaWiki:1.35]], the following | On a running instance of [[bkoo/MediaWiki:1.35]], the following restore.sh script can be launched using the following instruction: | ||
<SyntaxHighlight> | <SyntaxHighlight> | ||
docker exec dockerizedwiki_mediawiki_1 /var/www/html/extensions/BackupAndRestore/ | docker exec dockerizedwiki_mediawiki_1 /var/www/html/extensions/BackupAndRestore/restore.sh | ||
</SyntaxHighlight> | </SyntaxHighlight> | ||
Line 15: | Line 15: | ||
# Define the file name format and variable name | # Define the file name format and variable name | ||
FilePrefix="XLP" | FilePrefix="XLP" | ||
FilePostfix=".xml" | FilePostfix=".xml" | ||
# Define the latest literal string | # Define the latest literal string | ||
LATEST="LATEST" | LATEST="LATEST" | ||
# Construct the file name string | # Construct the file name string | ||
FileName=$FilePrefix$LATEST$FilePostfix | FileName=$FilePrefix$LATEST$FilePostfix | ||
echo "Ready to | echo "Ready to import all textual data from " $ResourceBasePath/images/$FileName | ||
php $ResourceBasePath/maintenance/ | php $ResourceBasePath/maintenance/importDump.php < $ResourceBasePath/images/$FileName | ||
# | # Load images from the UploadedFiles location. | ||
cd $ResourceBasePath | cd $ResourceBasePath | ||
php $ResourceBasePath/maintenance/ | php $ResourceBasePath/maintenance/importImages.php $ResourceBasePath/images/UploadedFiles/ | ||
</SyntaxHighlight> | </SyntaxHighlight> |
Latest revision as of 04:12, 26 March 2021
On a running instance of bkoo/MediaWiki:1.35, the following restore.sh script can be launched using the following instruction:
docker exec dockerizedwiki_mediawiki_1 /var/www/html/extensions/BackupAndRestore/restore.sh
The original Bash script can be seen here:
#! /bin/bash
# This variable should have the same value as the variable $wgResourceBasePath in LocalSettings.php
ResourceBasePath="/var/www/html"
# Define the file name format and variable name
FilePrefix="XLP"
FilePostfix=".xml"
# Define the latest literal string
LATEST="LATEST"
# Construct the file name string
FileName=$FilePrefix$LATEST$FilePostfix
echo "Ready to import all textual data from " $ResourceBasePath/images/$FileName
php $ResourceBasePath/maintenance/importDump.php < $ResourceBasePath/images/$FileName
# Load images from the UploadedFiles location.
cd $ResourceBasePath
php $ResourceBasePath/maintenance/importImages.php $ResourceBasePath/images/UploadedFiles/