Migrate existing data from the original Privacy Enhanced Gateway (PEG) version to the enhanced version of PEG.

Note: If you are running any version of PEG earlier than 3.3.22, we recommend updating for better security and performance.
These steps outline how to back up PEG data from an old VM and restore it to a new VM using the backup-data.py script.

Procedure

Perform the following steps on the old PEG VM (source).

  1. Copy the backup script ZIP to the old PEG VM: scp backup-script.zip peguser@<OLD_VM_IP>:/home/peguser/
  2. SSH into the old PEG VM: ssh peguser@<OLD_VM_IP>
  3. Unzip the backup script: unzip backup-script.zip cd backup-script/
  4. Create a snapshot of the old PEG VM.
  5. Run the backup script: python3 backup-data.py
  6. Confirm backup archive is created. Upon successful execution, the script generates a file like: es_backup_<YYYYMMDD_HHMMSS>.tar.gz - YYYYMMDD_HHMMSS.
    This file indicates the timestamp when the backup was taken. Example: es_backup_20250724_163210.tar.gz → July 24, 2025, 16:32:10
  7. Copy the backup file to the new PEG VM: scp es_backup_*.tar.gz peguser@<NEW_VM_IP>:/home/peguser/

Perform these steps on the new PEG VM (target).

  1. Launch a new VM using PEG 3.3.22 AMI.
  2. Install PEG 3.3.22 using your standard install process.
  3. Copy the backup script ZIP to the new PEG VM (if not already done): scp backup-script.zip peguser@<NEW_VM_IP>:/home/peguser/
  4. Use your SSH to log into the new PEG VM: ssh peguser@<NEW_VM_IP>
  5. Unzip the backup script: unzip backup-script.zip cd backup-script/
  6. Run the import command: python3 backup-data.py import.

Verify the new PEG VM environment.

  1. When complete, all previous data (users, events, word list, and regex list) should now be restored in the new PEG setup.