Synchronizing a wiki between 2 machines

Getting a wiki from the server

if [ -e wiki_is_local ]; then
echo "Wiki is already locally instantiated"
echo "Downloading files"
rsync -xavz --exclude LocalSettings.php /home/nens/
echo "Downloading database"
mysqldump -C --host= --user=NensWiki --password=passwd NensWiki >server_state.sql
echo "Inserting in local database"
mysql -h localhost -u NensWiki --password=passwd -D NensWiki

Putting a wiki towards the server

echo "Creating local copy of database"
mysqldump -C --host=localhost --user=NensWiki --password=passwd NensWiki >local_state.sql
echo "Synchronizing mediawiki directory"
rsync -xavz --exclude LocalSettings.php /home/nens/wiki
echo "Synchronizing remote database"
mysql -C -h -u NensWiki --password=passwd -D NensWiki

Leave a Reply

Your email address will not be published. Required fields are marked *