How to "recover" a database on aws to a new instance

I progressed a bit further. Now I know how to place the tar file and restore script into the /home directory inside the docker container. However, the restore script wants to execute under a bash shell, which apparently isn’t available. Attempting to execute the script under a ‘sh’ shell generates a huge number of errors and doesn’t seem to work either.

Get the docker container_id:

docker ps

Copy the tar file into the container:

ubuntu@ip-10-0-1-107:~$ sudo docker cp emr_backup_3.tar <container_id>:/emr_backup_3.tar

Access the docker container

sudo docker exec -it <container_id> sh

Then go to ~/ and move the tar file into /home

/var/www/localhost/htdocs/openemr # cd ~/
/ # mv emr_backup_3.tar home
/ # cd home

Copy the restore shell into /home

/home # cp /var/www/localhost/htdocs/openemr/contrib/util/restore .

Rename the restore script and make it executable

/home # mv restore restore.sh
/home # chmod u+x restore.sh

Note the database password in the sqlconf.php file

more /var/www/localhost/htdocs/openemr/sites/default/sqlconf.php

<?php // OpenEMR // MySQL Config $host = 'hosthosthosthost.us-east-1.rds.amazonaws.com'; $port = '3306'; $login = 'openemr'; $pass = '(((password)))'; $dbase = 'openemr'; At this point, I run into a roadblock. The bash shell doesn't seem to be available: ubuntu@ip-10-0-1-107:~$ sudo docker exec -it /bin/bash rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory" modifying the first line of the restore script from /bin/bash -> /bin/sh allows the script to execute, but it generates a huge number of errors .... I also tried correcting the name of the directory, but that did not work either. I guess the next step is to attempt to execute the relevant statements of the restore script manually one-by-one at the command line ... To be continued....