How to migrate data from Windows 10 OpenEMR 5.0.2(3) to AWS OpenEMR Cloud Express?

Hello everyone,

How do I migrate my working OpenEMR v5.0.2(3) on Windows10 to AWS OpenEMR Cloud Express? I have created an account on AWS and have a running OpenEMR Cloud Express instance which I have accessed in a browser. Now how to get my data from my PC into the Cloud?

I read openemr-devops/packages/express at master · openemr/openemr-devops · GitHub, searched for an answer on the forum posts, and tried AWS EC2 dashboard, but could not progress.

Any pointer would be appreciated. Thanks

hi @neville, you could use scp to move the files up to the cloud and then bring them into the docker with docker cp

Hi @stephenwaite , when I run

pscp -P 22 -i C:\pathtokey\key.ppk C:\pathtolocalbackup\emr_backup.tar ubuntu@ec2-publicdns.compute.amazonaws.com:/home/ubuntu/root/backups/emr_backup.tar

I get this error

pscp: unable to open /home/ubuntu/root/backups/emr_backup.tar: no such file or directory

The directory and path exist and I can cd into it with PuTTy. Please advise. Thanks

hi @neville, try

pscp -P 22 -i C:\pathtokey\key.ppk C:\pathtolocalbackup\emr_backup.tar ubuntu@ec2-publicdns.compute.amazonaws.com:.

Hi @stephenwaite, when I try that I consistently (3 tries) get

emr_backup.tar            | 3621152 kB | 4133.7 kB/s | ETA: 00:10:42 |  57%
error while writing: failure
C:\pathtolocalbackup\emr_backup.tar: Network error occurred

The file is visible by ls but filesize is 0. The same error comes even if I try a smaller 69.4kb file.

Hello,

If you aren’t able to push the file to the instance – and something sounds off about that; check with df to make sure you’ve got free space – you can always pull the file from the instance; place the backup .tar somewhere the instance can see it, like an FTP under your control, perhaps.

Thank you @jesdynf , it was a space issue. I modified the volume size from AWS console, and used pscp to get the archive onto the instance.

Hi,

When I try to move emr_backup.tar into \root\backups I get an error

ubuntu@ip-someip:~$ mv emr_backup.tar /root/backups
mv: failed to access '/root/backups': Permission denied 

Any advice would help. Thanks again

@neville

Try adding sudo before the command or else log in as root user(sudo -i) to perform the file move.
Hope this helps you.

Thanks,
ViSolve

@visolveemr thank you, that worked!

Hello again, I’m stuck at /root/restore.sh . My emr_backup.tar file is 8GB, so I increased the Volume size to 24GB. I’m unable to resolve recovery: invalid starting point .tar.gz . Here’s the full printout. All advice is appreciated. Thanks

restore.sh: confirmation acknowledged, beginning destructive restore ...
Local and Remote metadata are synchronized, no sync needed.
Last full backup date: none
Traceback (most recent call last):
  File "/usr/bin/duplicity", line 1532, in <module>
    with_tempdir(main)
  File "/usr/bin/duplicity", line 1526, in with_tempdir
    fn()
  File "/usr/bin/duplicity", line 1380, in main
    do_backup(action)
  File "/usr/bin/duplicity", line 1457, in do_backup
    restore(col_stats)
  File "/usr/bin/duplicity", line 722, in restore
    restore_get_patched_rop_iter(col_stats)):
  File "/usr/bin/duplicity", line 744, in restore_get_patched_rop_iter
    backup_chain = col_stats.get_backup_chain_at_time(time)
  File "/usr/lib/python2.7/dist-packages/duplicity/collections.py", line 970, in get_backup_chain_at_time
    raise CollectionsError("No backup chains found")
CollectionsError: No backup chains found

recovery: low free memory, temporarily allocating swap space
Setting up swapspace version 1, size = 2 GiB (2147479552 bytes)
no label, UUID=656b6886-8bd2-4e69-9a76-db9d5ddecc95
/root/xrecovery.sh: line 6: cd: /mnt/backups/bkps: No such file or directory
ls: cannot access *-info.log: No such file or directory
recovery: invalid starting point .tar.gz

------------
DIRE WARNING
------------

Your free memory was too low to complete the backup without unusual measures,
so I allocated extra swap space. Rebooting will release that swap space, and
this is necessary because you may incur significant long-term I/O expenses if
you're operating in AWS LightSail or EC2 and you leave swap activated. Please
do not forget to reboot this instance and delete /mnt/2GB.swap as soon as
practical.

Can you tell me more about where you got emr_backup.tar from?

My suspicion is that the restore script you’re trying to run is not compatible with the backup you’ve made. OpenEMR’s backup and restore is a process you run from inside OpenEMR. OpenEMR Cloud Express and Standard have an additional backup layer and you’re crossing the wires on the two, I think.

Thanks @jesdynf, I got the emr_backup. tar from my local Windows OpenEMR 5.0.2(3)

So is there a way to take my local data into Cloud Express without using emrbackup.tar?