RESTORE problems

schizchan wrote on Wednesday, February 10, 2010:

Hi.
I’m using a OpenEMR v3.1.0 on windows xp, and I have a back-up files: emr_backup.tar
Can anybody tell me how to restore my backup-data in another computer?

visolveemr wrote on Thursday, February 11, 2010:

Hi,

You want both OpenEMR appl & DB to be copied to a new machine? or Do you have the application running and want only the OpenEMR DB to be restored?

Can you provide some more details.

Thanks
ViCarePlus Team

schizchan wrote on Friday, February 12, 2010:

I have to change my PC for some reason, … !
I reinstalled OpenEMR and runs well, but I can’t restore my prior DB, and I have a backup file emr_backup.tar only.
Can I restore my prior DB with this emr_backup.tar file?

Thanks

visolveemr wrote on Friday, February 12, 2010:

Assuming the tar here refers only to DB Backup.

1. If the file is a simple backup file dumped with mysqldump, (assuming you have dumped as <emr dumpfile name>.tar)
    - Drop the existing EMR DB (with no data) in the new machine.
    - Create a  DB (with the same name) & exit
    - From the command prompt, restore the dump file.  ( mysql -u <rootuser> -p  <EMRDB> < <emr dump file>.  (MySQL doesn’t bother about the extension)

  2. If the file is a compressed file, you extract it & perform the above steps.

Hope this helps

Thanks
ViCarePlus Team

sunsetsystems wrote on Friday, February 12, 2010:

emr_backup.tar is the default name for a file produced by the Backup feature in OpenEMR.  It is an archive containing at least two files:

openemr.sql.gz
openemr.tar.gz

The first of these is the database backup, and the second is the web directory.  There is a restore script for Linux in the distribution, it is at contrib/util/restore.  However a restore on Windows would need to be done through a manual process and I’m not sure if anyone has documented that yet.  Some of the commands in the Linux restore script may be useful in that regard.

Rod
www.sunsetsystems.com

schizchan wrote on Saturday, February 13, 2010:

I really appreciate your help, but it seems a little bit difficult for me. Can you show me the details?
I got two files(openemr.sql.gz & openemr.tar.gz) after extract the emr_backup.tar, and openemr.sql after extract the file: openemr.sql.gz
I extract the file: openemr.tar.gz and cover the files of C:\xampp\htdocs\openemr, it’s OK
Then how to create a DB (with the same name)?
From the command prompt, I don’t know what’s the rootuser, which file I should choose for <EMRDB> and <emr backup files>. 
Can you show me the details? Please

tmccormi wrote on Tuesday, February 16, 2010:

The table, database and username for your system, assuming it was working before, can be found in openemr/library/sqlconf.php.
Look for this:
  $host = ‘localhost’;
   $port = ‘3306’;
   $login  = ‘openemr’;
   $pass   = ‘openemr’;
   $dbase  = ‘openemr’;

Now with msyqld running … on the command line type (replacing ‘openemr’ wiht you database names, etc)

    mysql -password -host=localhost -user=openemr -database=openemr

enter the password when prompted
at the MYSQL> prompt type
> drop openemr;
> source openemr.sql;

The will load the backup and recreate the database and all the tables.  The semi-colons are usually required…

> exit

That should do it.

-Tony

drgoody wrote on Saturday, July 03, 2010:

I am trying to follow the logic for the cmd line, but I’m have real trouble.
I am trying to more from the virtual machine 3.2 to the xampp 3.2 on an win xp pro sp3 platform.
I believe I have copied the era, edi, etc folders into xampp.
I cannot seem to get the cmd line instructions for restoration of the mysql database to work. I’ve tried from C: and C:\xampp and deeper into the xampp tree structure.
Thanks for any help that can be given. John

bradymiller wrote on Sunday, July 04, 2010:

hey,

mysql binary is here:
C:\xampp\mysql\bin

so to execute mysql:
C:\xampp\mysql\bin\mysql

-brady

drgoody wrote on Wednesday, July 07, 2010:

Thank you Brady for the help. It seems that the mysql data was copied using the cmd line, but I still don’t have access to my data. When I bring up openemr in xampp I can only login with the default login and password and none of the data is there.
I’m trying to transition from the Linux Virtual Machine to XAMPP on windows. Am I missing something? I copied over the data in Documents, ERA, EDI, and \custom\letter_templates. Do I need to move any other files? Thanks in advance, John

bradymiller wrote on Wednesday, July 07, 2010:

hey,

You also need the mysql database. The majority of data (besides patient docs and some billing docs) are housed in the mysqldatabase. Did you create a mysql dumpfile from the appliance? (either at cmd line or via the admin->backup feature in openemr?

-brady

drgoody wrote on Wednesday, July 07, 2010:

via admin->backup feature in openemr.

bradymiller wrote on Thursday, July 08, 2010:

hey,
Have you unpackaged that file that you created with the admin->backup feature. In that package, you will find the mysql backup (dump) file for your installation.
-brady

drgoody wrote on Sunday, July 11, 2010:

IT WORKED! I did not use the phpadmin function to import the openemr.sql database. Once I did that and performed the cmd line restore, it all appears to be working.
I see why those guys that do this for a living make the big bucks :slight_smile:
Difficult for us novices.
Thanks again for all the help. John

drgoody wrote on Thursday, November 11, 2010:

I moved my xampp installation to a different computer running win2k3 server. I followed the above steps, but my ICD-9 & CPT codes do not appear to have loaded. I started adding live data before I realized this happened. Any thoughts on how to handle this situation? Thanks, John

visolveemr wrote on Thursday, November 11, 2010:

Hi,

From the Phpmyadmin/mysql command line, check for the entries in the codes table and also prices table.  Make sure it is not empty. If it is empty, just take the dump of both tables from the previous setup and restore it in the new setup.

Thanks
ViCarePlus Team,
www.vicareplus.com
services@vicareplus.com