Restoring ODK Backup from one Web Server to Another

1. What is the issue? Please be detailed.
I currently have a main web server that takes in real data collection for our projects, I am trying to backup our data to our backup web server. I followed through the backup process here and was able to retrieve the .zip file via POST request from the main web server.

However, I encountered an issue when trying to restore the ODK forms via the downloaded zip files to my backup web server. This is the error that I am getting after running this command.

Command:

sudo docker compose exec service node /usr/odk/lib/bin/restore.js /data/transfer/backup.zip 'secret-passphrase'

Error:

Error: Command failed: pg_restore -e -j 4 -F d -C -c -h postgres14 -U odk -d template1 /tmp/tmp-157-vl3UsW2eVKi2
pg_restore: while PROCESSING TOC:
pg_restore: from TOC entry 5; 2615 2200 SCHEMA public odk
pg_restore: error: could not execute query: ERROR:  schema "public" already exists
Command was: CREATE SCHEMA public;

What is the process to troubleshoot this issue?

2. What steps can we take to reproduce this issue?
Adding more information on specs here:

  • Web server is run on AWS EC2
  • Run on t2.medium, 300GB EBS
  • No changes in the configuration setup

3. What have you tried to fix the issue?
None, just went through historically similar tickets, but no luck

4. Upload any forms or screenshots you can share publicly below.
None

This process worked in the past?
Is your backup server running the same version of Central?

@danbjoseph first time using it.

Main ODK Server v1.5.3
Backup ODK Server v2023.3.1

I believe ODK backups are forward compatible, yes?
Or would it be better if I change the Backup ODK Server to the same version as the main?

A restore needs to be done to the same version that created the backup.

2 Likes

@danbjoseph used the same version of ODK Central in my backup server (v1.5.3), it seems that the same error still persists. Any other suggestions to troubleshoot this issue?