Restoring backup of docker installation - new problem

Situation
I have come unstuck restoring a backup. I have followed the instructions here (message 52/131). The command in point 9 did not carry through, but stupidly I did not realise it and proceeded to point 10, which seemed to complete. However, when I then go to localhost/sql_upgrade.php in my browser, I get the Apache default page. Clearing the cache makes no difference. Here is my terminal output:

robert@robert-ideacentre-AIO-520-22IKU:~$ cd ~/Downloads
robert@robert-ideacentre-AIO-520-22IKU:~/Downloads$ docker ps
CONTAINER ID   IMAGE          COMMAND                  CREATED      STATUS             PORTS      NAMES
ae8693b8a741   mariadb:10.4   "docker-entrypoint.s…"   3 days ago   Up About an hour   3306/tcp   openemr_mysql_1
robert@robert-ideacentre-AIO-520-22IKU:~/Downloads$ docker cp /home/$USER/Downloads/openemr.sql ae8693b8a741:.
robert@robert-ideacentre-AIO-520-22IKU:~/Downloads$ docker exec -it ae8693b8a741 /bin/bash
root@ae8693b8a741:/# mysql -uroot -proot openemr < openemr.sql
root@ae8693b8a741:/# exit
exit
robert@robert-ideacentre-AIO-520-22IKU:~/Downloads$ docker exec -it $(docker ps | grep _openemr | cut -f 1 -d " ") /bin/sh
"docker exec" requires at least 2 arguments.
See 'docker exec --help'.

Usage:  docker exec [OPTIONS] CONTAINER COMMAND [ARG...]

Run a command in a running container
robert@robert-ideacentre-AIO-520-22IKU:~/Downloads$ wget https://raw.githubusercontent.com/openemr/openemr/rel-502/sql_upgrade.php
--2021-11-03 09:50:26--  https://raw.githubusercontent.com/openemr/openemr/rel-502/sql_upgrade.php
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.110.133, 185.199.111.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5477 (5,3K) [text/plain]
Saving to: ‘sql_upgrade.php’

sql_upgrade.php     100%[===================>]   5,35K  --.-KB/s    in 0s      

2021-11-03 09:50:26 (12,5 MB/s) - ‘sql_upgrade.php’ saved [5477/5477]

robert@robert-ideacentre-AIO-520-22IKU:~/Downloads$

OpenEMR Version
6.0.0 Docker

Browser:
Chrome, Firefox

Operating System
Linux Mint 19.1

Logs
Did you check the logs? No, if you need them, please tell me where to find them.

Many thanks.

nice

whoops, it’s a new problem, :blush:

your openemr docker isn’t up or else it would appear with the docker ps

Thank you. What does it mean that openemr docker isn’t “up”? Running? If so, why would that be and how do I bring it “up”?

(Excuse me, I am an osteopath, I only understand bodies :upside_down_face:)

try docker ps -a to see if it’s stopped

robert@robert-ideacentre-AIO-520-22IKU:~$ docker ps -a
CONTAINER ID   IMAGE                   COMMAND                  CREATED        STATUS                      PORTS                                                                      NAMES
81cfe62619f5   openemr/openemr:6.0.0   "./run_openemr.sh"       46 hours ago   Exited (255) 34 hours ago   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   openemr_openemr_1
ae8693b8a741   mariadb:10.4            "docker-entrypoint.s…"   4 days ago     Up About an hour            3306/tcp                                                                   openemr_mysql_1
robert@robert-ideacentre-AIO-520-22IKU:~$

docker start 81cfe62619f5

robert@robert-ideacentre-AIO-520-22IKU:~$ docker start 81cfe62619f5
Error response from daemon: driver failed programming external connectivity on endpoint openemr_openemr_1 (28cf0133bceaf277a3c7b94549203dc77a93d9a83afabe8edad94dced9cc19ee): Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use
Error: failed to start containers: 81cfe62619f5
robert@robert-ideacentre-AIO-520-22IKU:~$

sudo service apache2 stop
then try the docker start again obvi

Progress but localhost/sql_upgrade.php gives a blank page.

(localhost gives the openemr login page.)

right, now you have to redo those steps to pull the script into the docker

right, now you have to redo those steps to pull the script into the docker

I did!

(ghjglyguyyog ← to satisfy the 20 character rule :grin:)

1 Like
robert@robert-ideacentre-AIO-520-22IKU:~$ sudo service apache2 stop
[sudo] password for robert:       
robert@robert-ideacentre-AIO-520-22IKU:~$ docker start 81cfe62619f5
81cfe62619f5
robert@robert-ideacentre-AIO-520-22IKU:~$ cd ~/Downloads
robert@robert-ideacentre-AIO-520-22IKU:~/Downloads$ docker ps
CONTAINER ID   IMAGE                   COMMAND                  CREATED        STATUS              PORTS                                                                      NAMES
81cfe62619f5   openemr/openemr:6.0.0   "./run_openemr.sh"       47 hours ago   Up About a minute   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   openemr_openemr_1
ae8693b8a741   mariadb:10.4            "docker-entrypoint.s…"   4 days ago     Up 2 hours          3306/tcp                                                                   openemr_mysql_1
robert@robert-ideacentre-AIO-520-22IKU:~/Downloads$ docker cp /home/$USER/Downloads/openemr.sql ae8693b8a741:.
robert@robert-ideacentre-AIO-520-22IKU:~/Downloads$ docker exec -it ae8693b8a741 /bin/bash
root@ae8693b8a741:/# mysql -uroot -proot openemr < openemr.sql
root@ae8693b8a741:/# exit
exit
robert@robert-ideacentre-AIO-520-22IKU:~/Downloads$ docker exec -it $(docker ps | grep _openemr | cut -f 1 -d " ") /bin/sh
/var/www/localhost/htdocs/openemr # wget https://raw.githubusercontent.com/openemr/openemr/rel-502/sql_upgrade.php
Connecting to raw.githubusercontent.com (185.199.109.133:443)
saving to 'sql_upgrade.php'
sql_upgrade.php      100% |**********************************************************************************************************************************************************************************************|  5477  0:00:00 ETA
'sql_upgrade.php' saved
/var/www/localhost/htdocs/openemr #

it’s now 6.0.0 upgrade file you have to grab, rel-600

robert@robert-ideacentre-AIO-520-22IKU:~/Downloads$ docker exec -it $(docker ps | grep _openemr | cut -f 1 -d " ") /bin/sh
/var/www/localhost/htdocs/openemr # wget https://raw.githubusercontent.com/opene
mr/openemr/rel-600/sql_upgrade.php
Connecting to raw.githubusercontent.com (185.199.109.133:443)
wget: can’t open ‘sql_upgrade.php’: File exists
/var/www/localhost/htdocs/openemr #

rm sql_upgrade.php then grab again

Thank you, all Ok now (for now!).

Really appreciate your willingness to help.

Will I have to docker start 81cfe62619f5 every time I boot my system and want to use openemr?

the docker service should autostart or can be configured to do so

How to ensure your Docker containers automatically start upon a server reboot - TechRepublic covers both docker-compose (restart policy in yaml) and native Docker commands (which I worry that you’ve proceeded to with how you’ve manipulated your containers).

I find this morning that I do have to do ‘sudo service apache2 stop’ then ‘docker start 81cfe62619f’ at each reboot.

Yet in my docker-compose.yml I have ‘restart: always’.

I have looked at the example commands on the page you linked to @jesdynf but I do not know what the value after ‘-p’ should be, and I do not want to make a mistake with my command.

Can you help further?

Thank you.