Cross platform backup and Restore from Windows to LightSail local instance

I have a Windows Server 2019 installation with OpenRMR 6.1. I’ve installed OpenEMR on a Lightsail local instance in Ubuntu 20.04.1.

How can I restore a backup of my Windows instance to a LightSail instance on Ubuntu? I have data on the Windows instance and I want to import it to the LightSail instance using backup and restore.

I am trying to follow this link but I’m confused about the docker bit and the container where openERM is in.

I’m also looking at this link but am lost about what to do.

@discobot

The second link to Ben’s blog post is your best bet. Is there a particular step that’s giving you problems? You’ll want to start by creating a backup via the GUI on your Windows instance.

1 Like

Actually I wanted to know if my idea on cross platform backup and restore is doable.

I’ll try Ben’s Blog.

Thanks.

I did Create and download a full backup, and Download configuration data. I now struggling through Ben’s doc.

The difficult thing in Ben’s doc is the copy procedure. I get an error: copying between containers is not supported.

Leonard

You mentioned you have a local lightsail instance installed already, so are you at or past the “Copying file to docker database container” step?

1 Like

No, not there as yet as I still get this error: copying between containers is not supported. Looks like a permissions issue. Will Google the error to see how to modify permissions.

Y’know, I’ve never tested it, but it seems to me that you could expose the docker’s MySQL port and then conceal it again by editing the docker-compose file and doing repeated ups with no down.

No guarantee it wouldn’t delete data if you tried it, I’m not totally familiar with what happens when you up a running composition.

1 Like

If you’re copying from Windows, you have to put the path in quotes, else Docker will think “c:” is a container.

Thanks for the tip. I didn’t find any of my Google searches saying use “c”. However, I did see docs that said Docker treated the c:/ as a container.

Jason suggested I use “c:” so I’ll try it tomorrow and let you know how it goes.

No, put quotes around the path. If you were trying something like:

docker cp C:\openemr.tar.gz $(docker ps | grep _openemr | cut -f 1 -d " "):/var/www/localhost/htdocs/openemr/

change it to:

docker cp "C:\openemr.tar.gz" $(docker ps | grep _openemr | cut -f 1 -d " "):/var/www/localhost/htdocs/openemr/

1 Like

Ok. Thanks for the updates. I’ll try it and let you know.

These are my Docker containers

CONTAINER ID IMAGE COMMAND CREATE D STATUS PORTS NAMES
e8a6c9e3c1dc openemr/openemr:6.1.0 “./openemr.sh” 3 days ago Up 19 hours 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :: :443->443/tcp lightsail_openemr_1
5cdab6af5809 openemr/mysql-xtrabackup:latest “docker-entrypoint.s…” 3 days ago Up 19 hours 3306/tcp lightsail_mysql_1
I want to copy c:\openemr.sql.gz and c:\openemr.tar.gz to the Docker containers so I can import the data to a fresh installation of OpenEMR that I installed from lightsail.

This command didn’t work.

docker cp ‘C:\openemr.sql.gz’ e8a6c9e3c1dc:/home

hc4admin@openemrlightsail:~$ sudo docker cp ‘C:\openemr.sql.gz’ e8a6c9e3c1dc:/home
[sudo] password for hc4admin:
copying between containers is not supported

I’m trying to follow this Blog:
Open EMR Backup and Restore Docker Procedure
And I’m stuck at copying the gz files.

Have you tried double quotes? Is that path actually where your openemr.sql.gz file is?

Yes, I did use “”. Here is my configuration. C:/*.gz is the actual path.

I have OpenEMR 6.1 installed on Ubuntu in a Docker container. I followed the instructions in this page.

# OpenEMR Cloud: Do-It-Yourself Lightsail Edition

And I used this script to install Docker and OpenEMR 6.1

curl -L https://raw.githubusercontent.com/openemr/openemr-devops/master/packages/lightsail/launch.sh > ./launch.sh
chmod +x ./launch.sh && sudo ./launch.sh

From a Windows 10 PC, I SSH to Ubuntu and run the command
sudo docker cp “C:\openemr.sql.gz” e8a6c9e3c1dc:/home and got this result
copying between containers is not supported

Have I made a mistake in the cp command?

@discobot

My goal is to restore the gz files I backed up from my Windows installation of OpenEMR 6.1 as I want to migrate from Windows server 2019 XAMPP platform to a linux (Ubuntu 20.04) one. I have a May 2 deadline to go live with Open EMR 6.1. So I’m testing now.

@discobot

You have to first get the files onto the Ubuntu host. scp is the command you want.