Backup Windows installation with XAMPP, restore to Ubuntu 20.04 with LAMP: Can this be done?

I have a Windows XAMPP installation of Open EMR 6.1 (1). I want to switch to Ubuntu 20.04.1. Can I restore a backup of my Windows installation to the Ubuntu Linux platform with LAMP?

On the Ubuntu server I installed openemr 6.1. Next I renamed the openemr folder in /var/www/html to openemr_old, and then I dropped openemr database in mysql using phpmyadmin.

I imported to Ubuntu opememr.sql to mysql using phpmyadmin and openemr.tar to /var/www/html/openemr.

The result is I got a blank page when I browsed to http://ubuntusvr/openemr.

Now I ran the openemr 6.1 setup again and it completed successfully (l had to edit sqlconf.php first to run setup again), but I still got a blank page when I browsed to http://ubuntusvr/openemr.

Now there were lots challenges getting to this point, but I googled my way out of them.

Which brings me to the question: is a cross platform backup and restore possible?

Maybe.

I’m not prepared to offer support for XAMPP, nor am I completely familiar with your handrolled LAMP stack, but I can give you this. openemr-devops/ingestion.sh at master · openemr/openemr-devops · GitHub

ingestion.sh is a script designed to take a vanilla OpenEMR backup, that .tar file, and load it into my Lightsail-based Docker installs. You can’t run this directly, but you may find it instructive to see how I solved the problems you’re facing.

1 Like

nice work @LMoonsammy , just need to trouble shoot the blank page, do your credentials on ubuntu match what’s in sites/default/sqlconf.php?

Thank you for replying. I’ve checked and the credentials don’t match. Have to fix this.

I’ve corrected the credentials. But those credentials are not the ones from the original database.

No luck getting a login page.

ok, they just have to work for access to the openemr database on your new server. Can you test access to the database with those credentials independently?

I appreciate your advice.

I installed the LAMP following a tutorial on line. Apache2, Mariadb, PHP were installed with defaults config.

I’m not sure how the script you mentioned will help. But I’ll take a look at it to see if it helps.

It won’t help directly since you can’t use it, it’s just an example of how I did what you’re trying to do – maybe save you some Googling.

I need to figure out how to test the login to the database.

you can use the credentials with phpmyadmin or the mysql console

I used this command

mysql> GRANT ALL PRIVILEGES ON database_name.* TO 'username'@'localhost';

But I still get a blank page.

Have you solved the problem @LMoonsammy ? It is possible, but there are things to watch out for. The wrong DB credentials as you have seen above are one.

There could be others too that have more to do with the server setup itself. Maybe calls are being made to php or apache mods that you don’t have installed atm. XAMPP comes with a lot of things out of the box that you have to intentionally install or activate on a apache web server. (ssl, rewrite, php-xml, php-json) The server logs could tell more. Enable all debugging to be sure if it’s a PHP thing or an Apache thing. Make sure all settings on the server satisfy the requirements you see for OpenEMR during install.

I have never tried to move the way you described though, by installing then replacing the main directory. I copy the complete OpenEMR directory to the server. Upload the database and connect. But often i have to do somethings with the server to get it running. Some of you may also have seen this issue when you try to use the multi-site option. But it’s good to know, it’s solvable in 'most all cases.

2 Likes

Thank you for your reply.

I’ll enable the logs and troubleshoot as you suggested. Hopefully I’ll get it right.

I really need to transition to a linux platform.

There are a few steps that you need to consider. First, you want to make sure that your LAMP is set up correctly. The most clear directions are here:

Once you get the sample webpage to display “Success! The your_domain virtual host is working”, you have successfully set up a vitual host and you are ready to create a folder in the /var/www directory that will host OpenEMR.

Typically, I have a git repository that is separate from the host. Then I use rsync to sync my git repo with the live instance. Since you are switching machines, you will want to rsync the sites directory that has all your documents, era, and edi files to the new machine.

This can be a tedious task that is mistake prone if you haven’t done this before.

1 Like

Yes, this can definitely be done, I have done it a couple of times. Although I run FreeBSD, a server is a server.

A blank page is indicative of a few things. (PHP problem, database connectivity) We need to work with your logs.

I am assuming you are using everything out to the box, correct?
Are there any error in your apache log? how about your database log?

Do you know how to run the phpinfo() function?
Check this out:

https://www.php.net/manual/en/function.phpinfo.php

If you don’t want to read the whole thing, this is a short version:

Create a file, in your openemr directory, named “info.php” and add the following:

<?PHP

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
//phpinfo(INFO_MODULES);

?>

Make sure the file permissions are set to the web server.

Then go to a browser and type on the address bar:

https://yourdomain.net/info.php

A page with all your PHP installation details should open up:

If it does, this means that PHP is working correctly. Verify that the openemr PHP requirements are met, while you are at it. The problem, then, could be your database connection.

If it doesn’t, then the problem is your Apache/PHP installation.

1 Like

I installed Apache. I need to get openemr website over from the Windows installation.

I’ve checked php and it is running fine.

Is there any link to show how you can move opememr from Windows to Ubuntu?

1 Like

There really isn’t a set of instructions that I am aware of. I would make sure that you backup your database and documents before you attempt anything. Once you have a copy of your database, you ca install it on the new machine and point your sql_config.php file to use the newly installed database.

Then you want to rsync your documents from one machine to the other.

1 Like

I’ll try your recommendations and see how it goes. Thanks.

Check these out:

https://www.open-emr.org/wiki/index.php/Ubuntu_Server_Installation

There is also the openemr readme file here:

Like @growlingflea suggests, once PHP, and apache are up and running, I would do a fresh install of openemr 6.1.0 in ubutu. Then after restoring your database, point /openemr/sites/default/sqlconf.php file to it.

In windows create a .zip (or .tar.gz)file of your /openemr/sites/default/documents folder then using FTP upload it to your new ubuntu server and unpack it into your /openemr/sites/default/ directory.

In windows use 7-zip to create your documents.zip (or .tar.gz) file:

https://www.7-zip.org/download.html

If your have more questions, continue to post them here. maybe we could eventually come up with a tutorial.