Skip to content

Creating a New Installation

rrowlands edited this page Aug 13, 2020 · 13 revisions

Follow these steps to set up a new installation of the DDMS.

You Will Need

Before you can begin installation, you will need:

  • A computer with:
    • 64-bit Windows 7+
    • 8+ GB RAM
    • Administrator Privileges
  • External port access through your firewall for 8080 (for HTTP) or 8443 (for HTTPS)
  • A static IP address if you wish to access the machine outside your internal network
  • A domain name (e.g. ddms.com) for HTTPS. You may purchase one of these from your favorite domain name registrar. You may associate this domain name with your static IP address.
  • A Dropbox or Onedrive account, for usage in setting up automatic backups.
  • A DDMS Installer executable, which can be downloaded from the Releases section of this Github project.

Installation

  • Download an installer from Releases.
  • Run the DDMS installer on the machine. The installer will guide you through the process of installing the DDMS and all its prerequisite software such as Java, Postgres, and Tomcat. If you are planning to restore a backup, make sure the name of the installation exactly matches that which is in the backup.
  • We recommend creating a shortcut to the DDMS manager on the desktop of the machine. The DDMS Manager is located at C:\MDSS\manager\manager.bat. Right click on manager.bat and drag it to the desktop. Click "create shortcut".
  • If you want to restore an existing backup on the machine, copy that backup to the hard drive. Open the DDMS manager and restore the backup.
  • If you need to patch your backup, you can download a patcher executable from Releases. Run the patcher the same as you did the installer.

Configuring HTTPS

Configuring the DDMS to Start On Bootup

  • Search for "Services" and open the Windows Services configuration application.
  • Scroll down in the table until you find a service called "DDMS".
  • Double click on the "DDMS" Service to open the properties for the service.
  • Change the "Startup type" to "Automatic"

Automatic Backups

We recommend saving these backups on a cloud server, such as Dropbox or Google Drive. Dropbox will automatically sync the folder, however Google Drive can also be configured to do this.

  • Open the Windows Task Scheduler by searching for "Task Scheduler".
  • On the actions panel at the right, click "Create Task".
    • Name: Backup DDMS
    • Run whether user is logged on or not (check)

    • Create a new trigger. Configure when you want backups to occur. This backup schedule should be performed after any DDMS scheduled jobs (i.e. syncing with ODK) have finished running. Here are some sensible defaults:
      • Weekly
      • Recur every 1 weeks on Saturday

    • Create a new action.
      • Start a program
      • Program/Script: powershell
      • Add arguments (optional): -Command "powershell -ExecutionPolicy ByPass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File C:\MDSS\manager\manager.ps1 -backupAll C:\Users\Administrator\Dropbox\backups > C:\Users\Administrator\Dropbox\backups\backup.log"
      • You may need to change this command to save to a different location, if you're not using Dropbox.

    • Test this new task by right clicking on it in the table and clicking "Run". You can watch it run by looking at the log, which is referenced in the arguments you configured earlier. Additionally, you should see a new backup in the backups directory, referenced in the arguments you configured earlier.

Creating a Mirrored Server

It is possible to set up a DDMS installation as a "mirror" server. These mirrored servers are read-only installations which are reset from a "master" server somewhere else.

On the Master server, perform the following steps

  1. Create a shared folder between the master and the slave server by using a service like Dropbox
  2. If you don't yet have automated backups, do that first.
  3. Inside your shared folder, create the following directories: logs, transfer. Download this file backup-and-mirror.bat and save it to your new shared folder. As an example, this is what our directory structure looks like:
  • C:\path\to\google-drive
    • backups
    • logs
    • ssl
    • transfer
    • backup-and-mirror.bat

The "ssl" directory contains a backup of the current SSL certificate.

  1. Open the backup-and-mirror.bat file in a text editor (like Notepad++). Set the variables at the top of the batch file to point to your new shared folder.

  2. Change the command run by the "Backup DDMS" task in the Windows scheduler to instead run backup-and-mirror.bat, like as shown below.

  • The arguments as shown in the screenshot are " > C:\path\to\google-drive\logs\backup-and-mirror-task.log". You should change this to point to a path in your shared folder.
  1. Make sure that the task will always run. On the "Conditions" tab, check the "Wake the computer to run this task" checkbox. On the "Settings" tab, check the "Run task as soon as possible after a scheduled start is missed".

On the Slave server, perform the following steps

  • Download login.jsp and replace it with your login.jsp file in C:\MDSS\tomcat\webapps{app_name}\login.jsp. This will add a notification to your login screen which tells users that this is a read-only slave server.

  • Download ddms-mirror-slave.bat. Place it in your shared backup folder.

  • Open the Windows Task Scheduler by searching for "Task Scheduler".

  • On the actions panel at the right, click "Create Task".

    • Name: Mirror DDMS
    • Run whether user is logged on or not (check)
    • Create a new trigger. Configure when you want backups to occur. This backup schedule should be performed after the DDMS backup Windows scheduled task has finished running.
    • Make sure that the task will always run. On the "Conditions" tab, check the "Wake the computer to run this task" checkbox. On the "Settings" tab, check the "Run task as soon as possible after a scheduled start is missed".
    • Create a new action.
      • Start a program
      • Program/Script: C:\path\to\google-drive\DDMS\ddms-mirror-slave.bat
      • Add arguments: {your DDMS app name here}
    • Test this new task by right clicking on it in the table and clicking "Run". You can watch it run by looking at the log, which is referenced in the arguments you configured earlier. Additionally, you should see a new backup in the backups directory, referenced in the arguments you configured earlier. This task will not run unless there is a ddms backup in the transfer directory already.