relayman357
relayman357

Reputation: 855

duplicate mediawiki between 2 locations

I have setup a private wiki (1.35.1) running on Ubuntu Mate which is a guest OS on VMWare Workstation 16. I'd like to run this wiki at 2 locations (A & B) that are isolated (no VPN connection). I will be the only user accessing since it is my private wiki.

I've got the wiki setup and running at location A and will simply archive the guest and bring it up at location B as an identical copy.

Question: After I spend the day at location A (editing my wiki there), can i just simply copy the entire /var/www/html/Mediawiki folder and the entire /var/lib/mysql folder (MariaDB) onto a thumb drive and dump onto location B?

The intent is for these to be identical wiki's - synchronized by me (sneakernet) with thumb drive.

UPDATE - this is working well so far. Below is how i do it.

  1. Stop the mysql server - sudo service mysql stop
  2. Copy (using rsync) all new or changed files from /var/lib/mysql/ to my external share with: sudo rsync -cavurt --delete --info=del,name,stats2 "/var/lib/mysql/" "/home/rp/shares/VM_share_ubuntu/wiki_sql_files"
  3. Copy all new or changed files from /var/www/html/mediawiki-1.35.1 to my external share with: sudo rsync -cavurt --delete --info=del,name,stats2 "/var/www/html/mediawiki-1.35.1/" "/home/rp/shares/VM_share_ubuntu/wiki_mediawiki_files"
  4. Start the mysql server - sudo service mysql start

Now, copy the new/changed files to the 2nd machine:

  1. Stop the mysql server - sudo service mysql stop
  2. Copy in (using rsync) all new or changed mysql files with: sudo rsync -cavurt --delete --info=del,name,stats2 "/home/rp/shares/VM_share_ubuntu/wiki_sql_files/" "/var/lib/mysql"
  3. Copy in all new or changed mediawiki files with: sudo rsync -cavurt --delete --info=del,name,stats2 "/home/rp/shares/VM_share_ubuntu/wiki_mediawiki_files/" "/var/www/html/mediawiki-1.35.1"
  4. Start the mysql server - sudo service mysql start

In those rsync commands note that the end of the source folder needs to be / and the target folder does NOT have the ending /. The significance of that is explained in this thread.

UPDATE 2: If you modify the /etc/php/7.4/apache2/php.ini file on one machine you will need to make sure to make the same update on the other machine. e.g. If you change the file upload size from the default 2M or some other change that affects php.ini.

Upvotes: 0

Views: 199

Answers (1)

Tgr
Tgr

Reputation: 28160

This would mostly work as long as you set $wgServer dynamically. Pages that use absolute URLs and are loaded from cache would link to the wrong URL, but that should be very rare - almost everything uses relative URLs.

Upvotes: 1

Related Questions