Backup and Restore of DokuWiki

In order to schedule automatic backups you must first mount the Helpdesk network share, then create a script to copy the Dokuwiki directory, then schedule a Cron Job to automate it.

Mounting a network drive

  1. The first thing we need to do is to install CIFS.
     sudo apt-get install cifs-utils 
    1. It will prompt you to type Y or n. Type Y and the press enter.
  2. Next, create the mount directory (this will be the file path to the share).
    sudo mkdir /media/backup
  3. Create a file to hold the credentials used to mount the network share.
     nano ~/.smbcredentials 
    1. Enter the username and password for the dokuwiki backup account
      username=<username>
      password=<password>
    2. Change the permissions to make the file accessible only to your account.
      chmod 600 ~/.smbcredentials
  4. Then, edit your /etc/fstab file sudo nano /etc/fstab to add this line:
    //172.17.5.10/bk_dokuwiki /media/backup cifs credentials=/home/doku/.smbcredentials,domain=ad.collegedaleacademy.com,iocharset=utf8,sec=ntlm,vers=2.0 0 0
    1. Note that the domain value needs to be set to the correct information for the dokuwiki backup domain account and may need to be changed.
  5. Finally, test the fstab entry by issuing:
    sudo mount -a
  6. If there are no errors, you should test how it works after a reboot. Your remote share should mount automatically. This can be checked by verifying that you can still read and write to /media/backup.

Modified from: https://wiki.ubuntu.com/MountWindowsSharesPermanently

Script to copy the Dokuwiki directory

Dokuwiki is backed up as part of the Cyrus Backup Solution. The below Powershell script is called from Cyrus-Backup-Client.ps1 and executes the backup of Dokuwiki.

Backup-Dokuwiki.ps1

Archived Dokuwiki backup instructions (no longer used)

This assumes that DokuWiki is installed on Ubuntu Server already.

Perform the same steps as to manually backup, this time uploading the Data directory from the Local site navigation pane instead of downloading it from the Remote site.

*Note that you will need to give yourself read/write permissions to the dokuwiki backup directory temporarily, or you will need to log into the computer with the DokuWiki backup admin domain account.

  1. Open FileZilla
  2. Log into the server using the following information: Host: 172.17.5.78, Username: doku, Password: (enter password), Port: (leave blank). Click Quickconnect.
  3. In the Local site navigation pane (on the left side) navigate to \\nas1\d$\nasShare\dr\dokuwiki\. You can copy-paste it in or type it in.
  4. In the Remote site navigation pane (on the right side) navigate to /home/dou. Again, you can copy-paste it in or type it in.
  5. In the Local site pane, Right click on the most recent .tar.gz file folder and hit upload.
  6. Once the files have finished uploading, the Queued files tab at the bottom will be empty again.
  7. Close out of FileZilla.
  8. SSH into the dokuwiki server, and extract the .tar.gz file.
    1. tar xvzf <name of tar.gz file (eg. 11-19-17.tar.gz)>
  9. Copy the dokuwiki folder from the newly extracted folder to /var/www/
    1. sudo cp -r ~/var/www/dokuwiki /var/www/
  10. Configure the automatic backup as per the instructions above.
  • dr/dokuwiki_backup_and_restore.txt
  • Last modified: 2019/03/15 17:05
  • by ericclaus