Data conversion from windows to ubuntu linux

xiaoanri wrote on Sunday, December 21, 2008:

I am currently trying to have openemr set up on a ubuntu system, and wonder how I can convert the old patient data from a windows platform server to the new ubuntu system.  I have tried to find some clues on the internet but so far no luck.  Any help is greatly appreciated!

gutiersa wrote on Saturday, December 27, 2008:

depends on the database you have on the windows server!
What emr are you trying to import from?

drbowen wrote on Sunday, December 28, 2008:

Assuming that you are using openemr on your MS Windows platform and the two versions of OpenEMR are the same:

You need to use the mysqldump program.

C:>mysqldump -u root -p openemr > openemr_today.sql

move the openemr_today.sql to your Ubuntu server:

$ mysqladmin -u root -p openemr < openemr_today.sql

That’s it.

If you do not have the same versions of OpenEMR on the Windows server and the Ubuntu server you need to upgrade the old server to the same version as on the Ubuntu.

If you don’t you’ll end up with a version mismatch between your MySQL OpenEMR tables and the actual OpenEMR installed on the Ubuntu.  This can be fixed but amounts to patching the OpenEMR tables to upgrade the data after being transferred.

Always back up your OpenEMR data before you start making these types of changes.

Sam Bowen, MD

xiaoanri wrote on Sunday, December 28, 2008:

The database is from OEMR-2.9.0 running on windows server2003, I am trying to get it loaded to OEMR-2.9.0 running on Ubuntu 8.04. 

I tried Dr. Bowen’s commands, the computer asks me the password, to which I entered the password for phpmyadmin, did not work.  I do not recall setting up another password.  Here is the script:

mysqladmin: connect to server at ‘localhost’ failed
error: ‘Access denied for user ‘root’@‘localhost’ (using password: YES)’

I then tried to go to http://localhost/phpmyadmin, log in and then click "openemr" tab under database, then "import", follow the prompt and got the following error msg:

#1007 - Can’t create database ‘openemr’; database exists

Donot know what to do now. 

gutiersa wrote on Monday, December 29, 2008:

what you need is the password for the root user in mysql. Maybe you are using the wrong password, or you never set it up in the first place. Try hitting enter at the prompt without entering any password. If this works (dont tell us here) you really need to secure your mysql server.

drbowen wrote on Monday, December 29, 2008:

The mysqldump command if you have not set the password is to just leave out the "-p":

C:>mysqldump -u root openemr > openemr_today.sql

And as Dr. Gutierrez suggests, it is very important to secure your mysql installation.  By default mysql does not require a root password but it is leaving the barn door open not to set a root password.

Sam Bowen, MD

xiaoanri wrote on Tuesday, December 30, 2008:

What you suggested worked, Thank you all, Drs. Bowen and Gutiersa. It was really helpful–I was up whole day yesterday could not find the way to load the data.  Now I am ready to try each individual funcitons on the new server.  Thanks again!

xiaoanri wrote on Friday, January 02, 2009:

I thought everything would be fine from here on, but it is not.  It seems working well without any change of the root passwd of mysql (there is no passwd).  When I try to put a password (tried with phpmyadmin and putting the passwd in command line both), I was able to log in to mysql at command line and view the tables with the new password: "# mysql -p openemr", then "show tables;", but can not log in to openemr any more.  When logging in, it gives me this error msg: 

Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user ‘root’@‘localhost’ (using password: NO) in /var/www/openemr/library/adodb/drivers/adodb-mysql.inc.php on line 335

Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user ‘root’@‘localhost’ (using password: NO) in /var/www/openemr/library/adodb/drivers/adodb-mysql.inc.php on line 335

Warning: Cannot modify header information - headers already sent by (output started at /var/www/openemr/library/adodb/drivers/adodb-mysql.inc.php:335) in /var/www/openemr/library/auth.inc on line 142

It seems oemr did not know there is  a password now and still try to access mysql without one.  Could not figure out which file to put the passwd or make any other change. 

Please help, and thanks a lot!

drbowen wrote on Friday, January 02, 2009:

I don’t think it is a good idea to be operating with a root password.

Your errors suggest that using a root password is required for this connection to occur:

"using password: NO"

Sam Bowen, MD

xiaoanri wrote on Friday, January 02, 2009:

I guess I am confused with 2 things, I thought from your prior msg a root passwd is a must-have to safeguard the data.  What am I mixing up?

cfapress wrote on Wednesday, January 07, 2009:

It would be helpful to know where you’re currently stuck.

Did you get the data off the Windows Server?
- Just the physical files

Did you transfer the data to the Linux Server?
- Just the physical copy of the database export files

Have you created the OpenEMR database on the Linux Server?
- This happens when you install OpenEMR

Did you successfully import the exported data into the Linux Server?

On the LINUX server take a look at the file <openemr>/library/sqlconf.inc. In there you should see the database host, port, username, password, and database name. Are they what you expected to see? For an example, on my server, I have
$host   = ‘localhost’;
$port   = ‘3306’;
$login  = ‘XXXXXXXXXXX’;
$pass   = ‘XXXXXXXXXXX’;
$dbase  = ‘openemr’;

Jason