Wiki Backup: Difference between revisions

From Minetest
No edit summary
No edit summary
Line 27: Line 27:
First, log-in as "root" or do "sudo bash". Then run a script similar to the following.
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 750 MB of disk space free in the associated filesystem. Set DATE6D to a 6-digit date.
Replace '''/backupdir''' with a full path for a non-existent backup directory. Make sure that there is at least 1 GB of disk space free in the associated filesystem. Set DATE6D to a 6-digit date.


  set -e
  set -e
  mkdir -p /backupdir
  mkdir /backupdir || exit 1
  cd       /backupdir/
  cd   /backupdir/
  #
  #
  DATE6D=240709
  DATE6D=240709

Revision as of 00:17, 4 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 1 GB of disk space free in the associated filesystem. Set DATE6D to a 6-digit date.

set -e
mkdir /backupdir || exit 1
cd    /backupdir/
#
DATE6D=240709
mysqldump -A > mtwiki-$DATE6D.sql
mysqldump --system=users > mtwiki-users-$DATE6D.sql
gzip -9 *.sql
#
tar zcf mtwiki-tree-$DATE6D.tgz /var/www/wiki.minetest.org/
tardate *.tgz
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.