Are upgrade instructions AWS Standard Edition 5.0.2(5) to 6.0.0 available?

I’m going to try that! Thank you for the tip!

Update: Stack creation failed for the following reasons:
The following resource(s) failed to create: [PublicSubnet2, OpenEMRKey, PrivateSubnet, igAttach, PublicSubnet1, PrivateSubnet2, CloudTrail]. Rollback requested by user. I will put in an AWS tech support case and see if they have any ideas.

:frowning: I wonder if this is easy to work around…

oh right, @jesdynf may require a specific region

believe you may request aws to allow you more VPC’s for that region though

I had not encountered a limit on VPC creation before – Stephen is right, you can request account limitations be relaxed and they’re usually willing to honor them.

A script that hasn’t been tested enough is openemr-devops/OpenEMR-Standard-Recovery.json at master · openemr/openemr-devops · GitHub , a CloudFormation recovery template designed to work with an existing Standard installation and make a side-by-side duplicate using snapshots and backups. But at a minimum I don’t think the AMIs encoded in the script are correct any more, and I think it’s been a while since I rebuilt it from the stack source, and it would also fall afoul of the VPC creation threshold you describe.

(Why has it gone unmaintained? Because /nobody’s using it/.)

1 Like

The reason I could not launch another Cloudformation “stack” of the AWS OpenEMR 5.0.2 Cloud Standard Edition is that I reached the limit of five cloudthreads… I deleted 3 to make room. Also, I had my VPC limit quota increased so that was no longer a problem. Then I was able to launch a new 5.0.2(5) stack successfully in a new region. I’m going to try to migrate my EMR data to the new test system, install a new SSL certificate on the tests system and attempt to upgrade it to 6.0.0. Thank you for all the help so far. I will take a look at the backup/restore as a mechanism for migrating the EMR data. Creating images and migrating them Is another option, and I may try that also.

I was able to create an “empty” OpenEMR 5.0.2 Cloud Standard Edition system in another region. Next, I tried to migrate a copy of the production system over to the other region … that was not so successful. When I tried to connect to the webserver … no login page. I made sure the /var/www/localhost/htdocs/openemr/sites/default/sqlconf.php file was updated with the new database rds instance name, but I suspect there must be more to consider when you move to a new region.

One idea I had was to create a backup of the original production 5.0.2 database and restore it to the “empty” 5.0.2 test system. Next, I would somehow backup the patient “documents” and restore those onto the the “empty” 5.0.2 system (EC2 instance). Is this the “duplicity backup”?

Hi Ralf, a rough manual backup could be achieved where you would take the download created from openemr, fire up a phpmyadmin docker on the ec2 running the new openemr and import into the new rds, then you can scp the pt docs there and extract them into the documents folder after using docker cp

@jesdynf’s guides are worth investigating for their elegance in light of the previously mentioned approach

1 Like

are there any programmers that can help us to upgrade from emr version 4.02 to the latest version. Please feel free to email us, the charge and we might consider to contact you back.

thanks

appointmentmedconsultasia@gmail.com

Can I please ask for your advise about how to backup before upgrading? What we had done was compress data base to zip file. But turned out we could not reinstall from the zip file. So we are scared to upgrade.
Your advise will be highly appreciate.
Thank you in advance

Hi Donna Robinson,

The backup and restore of OpenEMR database is a simple and straightforward process. Instead of compressing the database you could prefer using the built in backup procedure that is available within the OpenEMR application.

Before you proceed, it is recommended that you perform the default backup process in a test server.

If you ran into any issues please feel free to contact us at openemr.support@visolve.com

Regards,
ViSolve-118

Donna,

I’ve never used Open EMR 4.0.2 unless you meant 5.0.2 I would follow the official backup procedures outlined in the wiki if you have a bare metal install and practice restoring it with a local version first and ensuring everything is in working order before doing the production upgrade.

If you are using a docker setup then the process is a bit more involved and I have not seen any documentation on how to restore but I will see if I can make a tutorial and possibly post it somewhere in the docs.

Good luck.

I’m attempting to create a backup manually for the OpenEMR 5.0.2(5) Cloud Standard Edition. I was able to mysqldump the database to an openemr.sql.gz file using the CLI instructions. However, when I try to tar -C /var/www/localhost/htdocs/openemr/ -zcf openemr.tar.gz ./ in the docker I run out of disk space. I don’t really know how to tar from outside the docker … I suppose I could take pieces of /var/www/localhost/htdocs/openemr/ and archive them. There must be a better way. Could the archive go into an S3 bucket perhaps?

I did a test backup/restore yesterday from my ec2 instance to my local environment and everything worked out fine.

I will run the process again restoring to my raspberry pi and document it but you can just use the backup option under administration that gets you all the files you need to restore your openemr instance.

Restoring is the tricky part since you have to get these tars to their respective containers using docker cp.

Try it with a 35GB MySQL (1.8 GB Gzip) database and maybe 10 GB of patient chart documents. The automatic method no longer works under these circumstances. I don’t know why the database is getting so large. I understand the large size of many digitized documents.
RBL

Did you try increasing your disk space? There is no way you are going to be able to make a backup of the db if you don’t have the disk space required that is why the regular backup method is most likely not working either.

Try resizing your EC2 volume to double its current capacity and see if making a backup of the database works.

1 Like

you can resize the EC2 but not sure that /mnt/docker resizes automatically

As promised here is the tutorial on how to backup/restore @brady.miller @stephenwaite @sjpadgett if you guys can review this to make sure there is nothing that can adversely affect anything I would appreciate you let me know so I can fix it, thanks :pray:

1 Like

looks great, some really nice tips and tricks, thank you @benmarte!

1 Like

THANK YOU VERY MUCH
Have a great day

1 Like

@benmarte, very nice!

1 Like

Okay, finally, after much effort, I was able to create an AWS OpenEMR Standard Edition v5.0.2p5 test system with my production database to try out the upgrade to v6.0.0 with docker-compose. I skipped messing around with production TLS/SSL certificates for now and just used the default v5.0.2p5 TSL/SSL system certificate defaults.

To create the test system, I was able to use cloudformation to create the system. Then, I manually copied the tables over (since trying to migrate them all at once failed for various reasons). I copied the chart documents over as a group. I tested the test system to make sure it was working correctly.

I tried the ./docker-compose up -d command at the EC2 instance (web server) /usr/ubuntu/ command line, but that failed. I couldn’t run the docker-compose initially because docker-compose was not installed (command not recognized), so I installed it.

sudo apt install docker-compose

Next, duplicity backup failed … not the main concern here … just a note.

I had to create my own docker-compose.yml file from the message above

version: '3.1'
services:
  openemr:
    restart: always
    image: openemr/openemr:6.0.0
    ports:
    - 80:80
    - 443:443
    volumes:
    - logvolume01:/var/log
    - sitevolume:/var/www/localhost/htdocs/openemr/sites
    environment:
      MYSQL_HOST: 'xxxxxxxxx.yyyyyyyyyy.us-east-1.rds.amazonaws.com'
      MYSQL_ROOT_USER: openemr
      MYSQL_ROOT_PASS: 'zzzzzzzzzz'
      MYSQL_USER: openemr
      MYSQL_PASS: 'zzzzzzzzzzzzz'
      OE_USER: admin
      OE_PASS: 'zzzzzzzzzzzz'
volumes:
  logvolume01: {}
  sitevolume: {}

Stored this in a docker-compose.yml file and copied it to the /root/openemr-devops/packages/lightsail/ directory

Next, I created an upgrade shell-script that I called upgrade.sh and gave execute permissions.

#!/bin/sh

# pull in 6.0.0 container
cd /root/openemr-devops/packages/lightsail
sed -i 's/5.0.2/6.0.0/' docker-compose.yml
docker-compose up -d

Then, I executed the script with sudo:
sudo ./upgrade.sh

This failed because the .yml script version was not supported.

Thus, I changed the version: '2' to a supported version.

Here is the output (without the dynamic progress bars):

Creating network "lightsail_default" with the default driver
Creating volume "lightsail_sitevolume" with default driver
Creating volume "lightsail_logvolume01" with default driver
Pulling openemr (openemr/openemr:6.0.0)...
6.0.0: Pulling from openemr/openemr
801bfaa63ef2: Pull complete
c0fca5602b80: Pull complete
16ae7646d015: Pull complete
25745d6986aa: Pull complete
287024c5c48f: Pull complete
7748783f7444: Pull complete
a738d3d8c0bd: Pull complete
fbd98a41f2ba: Pull complete
617f72cc72f3: Pull complete
0edf1a638799: Pull complete
f77ec4b287c9: Pull complete
161d4566e8be: Pull complete
d484f49c1af7: Pull complete
f07d96935550: Pull complete
e3361e0f055d: Pull complete
371e6fb1a227: Pull complete
5020cb166b70: Pull complete
Digest: sha256:12e3549a52df9240e8c0a0603ed3070aa482e05f6806caf2549a20982df6c000
Status: Downloaded newer image for openemr/openemr:6.0.0
Creating lightsail_openemr_1

ERROR: for openemr  Cannot start service openemr: driver failed programming external connectivity on endpoint lightsail_openemr_1 (5d29edb80ff448040b7e1a4fc8448766bc7f5dc475c786f47aa561c23a80e76c): Bind for 0.0.0.0:443 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

Next, sudo reboot the instance for what it’s worth.

When I check the version, it is still v5.0.2p5 – the upgrade to 6.0.0 failed.

Any help getting this upgrade process to work would be appreciated.