Wiki Backup: Difference between revisions

From Minetest
(Created page with "<div class="p44_navbar"> Wiki Top Minetest MT worlds Bucket Game Trolltest </div> <div class="p44_navbar"> [https://minetest.org/ minetest.org] [https://minetest.io minetest.io] [https://git.minetest.io/ 9,000 gits] [https://irc.minetest.org:9000/#/connect CoderChat] [https://edgy1.net/ EdgyNet] </div> <br /> <span id="backup-wiki"></span> == How-To Backup Wiki == To back-up this wiki involves these...")
 
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
<div class="p44_navbar">
<div class="p44_navbar">
[[Main_Page|Wiki Top]]
[[Main_Page|Start Page]]
[[Browser_Play|Browser Play!]]
[[Minetest|Minetest]]
[[Minetest|Minetest]]
[[MTWorlds|MT worlds]]
[[MTWorlds|MT worlds]]
[[Bucket_Game|Bucket Game]]
[[Bucket_Game|Bucket Game]]
[[Trolltest|Trolltest]]
[[Trolltest|Trolltest]]
[[Downloads|Downloads]]
[[Contact|Contact]]
[[Devel_Center|Devel Center]]
</div>
</div>


Line 15: Line 19:
</div>
</div>


<br />
<span id="backup-wiki"></span>
<span id="backup-wiki"></span>
== How-To Backup Wiki ==
== How-To Backup Wiki ==


To back-up this wiki involves these steps. Note: This procedure includes a full MariaDB backup. First, log-in as "root" or do "sudo bash". Then run a script similar to the following.
To back-up this wiki involves these steps. '''Note:''' This procedure includes a full MariaDB backup.


Replace '''/backupdir''' with a full path for a non-existent backup directory. Make sure that there is at least 250 MB of disk space free in the associated filesystem.
First, log-in as "root" or do "sudo bash". Then run a script similar to the following.
 
Replace '''/backupdir''' with a full path for a non-existent backup directory. Make sure that there is at least two GB of disk space free in the associated filesystem. Set DATE6D to a 6-digit date.


  set -e
  set -e
  mkdir -p /backupdir
  # Don't use "mkdir -p" here.
  cd       /backupdir/
mkdir /backupdir || exit 1
  cd   /backupdir/ || exit 1
  #
  #
  DATE6D=240709
  DATE6D=230923
  mysqldump -A > mtwiki-$DATE6D.sql
  mysqldump mediawiki    > mariadb-mediawiki-$DATE6D.sql
  mysqldump --system=users > mtwiki-users-$DATE6D.sql
mysqldump olddevwiki  > mariadb-olddevwiki-$DATE6D.sql
  mysqldump --system=users   > mariadb-users-$DATE6D.sql
  gzip -9 *.sql
  gzip -9 *.sql
  #
  #
  tar zcf mtwiki-tree-$DATE6D.tgz /var/www/wiki.minetest.org/
# The "*" in the next two lines is/are required.
  tar zcf   mtwiki-tree-$DATE6D.tgz /var/www/wiki.minetest.org/*
tar zcf mtolddev-tree-$DATE6D.tgz /var/www/olddev.minetest.org/*
  tardate *.tgz
  tardate *.tgz
  ls -l
  ls -l


'''Note:''' The "/*" in one line above is needed because the directory above that may be a syslink. This will cause top-level dot-files to be skipped but as of Fall 2023 there weren't any.
Notes:
 
* The "/*" in the "tar" command above is needed because the directory that is being backed up may be a syslink. The "/*" will cause top-level dot-files to be skipped but as of Fall 2023 there weren't any.
 
* "tardate" is an OldCoder utility. If it isn't installed on the current system, the "tardate" command used here is optional.

Latest revision as of 20:49, 23 September 2023

How-To Backup Wiki

To back-up this wiki involves these steps. Note: This procedure includes a full MariaDB backup.

First, log-in as "root" or do "sudo bash". Then run a script similar to the following.

Replace /backupdir with a full path for a non-existent backup directory. Make sure that there is at least two GB of disk space free in the associated filesystem. Set DATE6D to a 6-digit date.

set -e
# Don't use "mkdir -p" here.
mkdir /backupdir  || exit 1
cd    /backupdir/ || exit 1
#
DATE6D=230923
mysqldump mediawiki    > mariadb-mediawiki-$DATE6D.sql
mysqldump olddevwiki  > mariadb-olddevwiki-$DATE6D.sql
mysqldump --system=users   > mariadb-users-$DATE6D.sql
gzip -9 *.sql
#
# The "*" in the next two lines is/are required.
tar zcf   mtwiki-tree-$DATE6D.tgz /var/www/wiki.minetest.org/*
tar zcf mtolddev-tree-$DATE6D.tgz /var/www/olddev.minetest.org/*
tardate *.tgz
ls -l

Notes:

  • The "/*" in the "tar" command above is needed because the directory that is being backed up may be a syslink. The "/*" will cause top-level dot-files to be skipped but as of Fall 2023 there weren't any.
  • "tardate" is an OldCoder utility. If it isn't installed on the current system, the "tardate" command used here is optional.