Restore fails

rdh61 wrote on Thursday, March 01, 2012:

Hi,

Trying to restore a backup (openemr 4.1.0 (recent upgrade from 3.2) on Ubuntu 10.10, I get the following error:

robert@robert-workdesk:~$ sudo ./restore
password for robert:
WARNING: This script is experimental.
It may have serious bugs or omissions.
Use it at your own risk!
Now you will be asked for the backup file.
By default this is named emr_backup.tar, although you may have saved it as something else.

Enter path/name of backup file: /home/robert/emr_backup.tar

Extracting /home/robert/emr_backup.tar …
tar: Substituting `.’ for empty member name
Extracting /tmp/emr_backup/openemr.tar.gz …

Do you want to specify new locations and database names for the restore?  n

Error: The OpenEMR directory path ‘$webserver_root = dirname(dirname(__FILE__));’ does not start with ‘/’.
robert@robert-workdesk:~$

How can I solve this quickly?

Many thanks.

P.S. The backup was made with v4.1.0.

rdh61 wrote on Saturday, March 03, 2012:

Bump!

I still cannot find a way to solve this. Please help.

bradymiller wrote on Saturday, March 03, 2012:

Hi,

What do you see if you manually untar the file?

There is also a manual way to restore from this file that is documented here:
http://www.open-emr.org/wiki/index.php/Windows_OpenEMR_Restore_using_emr_backup.tar
(note it is for windows, but the general idea is the same in linux)

-brady

rdh61 wrote on Saturday, March 03, 2012:

Hi,

I see:
1) openemr.sql.gz
2) openemr.tar.gz

On the page you refer to I don’t understand the last 2 sections (Open phpMyAdmin, Restore openemr database). Please could you spell out what to do here for linux (ubuntu)?

Many thanks.

bradymiller wrote on Sunday, March 04, 2012:

Hi,

There are two parts to OpenEMR; the website directory and the mysql database.

The website directory is saved in the openemr.tar.gz file, so all you basically need to do is unpackage this in the website directory; if using ubuntu then at /var/www/openemr .

The mysql database is a bit more complicated. The steps include:
1. Creating a mysql database (use same name as in the /var/www/openemr/sites/default/sql_conf.php file)
2. Creating a mysql user that has privileges to modify the above database (set the user and password that are in the  /var/www/openemr/sites/default/sql_conf.php file)
3. Unpackage the openemr.sql.gz file and then import it into the database created in step 1

The above three steps can be done via command line or via phpmyadmin.
For a tutorial on how to do steps 1-2 via commandline see here:
http://www.debuntu.org/how-to-create-a-mysql-database-and-set-privileges-to-a-user
For a tutorial on importing the above sql file into the database via commandline, see here:
http://www.cyberciti.biz/faq/import-mysql-dumpfile-sql-datafile-into-my-database/
(specifically, look at STEP #3)

hope this helps,
-brady

sunsetsystems wrote on Sunday, March 04, 2012:

Might be an easier solution.  Where did the restore script come from?  Kinda sounds like it is not the release 4.1.0 version.  Be sure to use the restore from the same version that you backed up.

Rod
www.sunsetsystems.com

rdh61 wrote on Sunday, March 04, 2012:

@ Rod

Ah, how easy it is to overlook these things (dammit!), you’re spot on.

When I used the correct restore script I still got an error message:

Error: Site ‘default’ already exists in ‘/var/www/openemr/sites’.

However, by removing the ‘default’ folder, I could get the restore to carry through (a new ‘default’ folder was created), and my database is now working.

THANK YOU.

rdh61 wrote on Sunday, March 04, 2012:

@ Brady

Many thanks for taking the time to explain. As you can read in the above, though, I won’t need to do it long-hand now.

Best regards.

sunsetsystems wrote on Monday, March 05, 2012:

The error about the site already existing indicates you were restoring on top of an existing OpenEMR web directory, in which case the default site would also already exist.  That should be fine if that existing directory is also from the desired release… normally you only restore on top of an existing directory if you are restoring the second site or beyond of a multi-site installation.

Glad you are in business now!

Rod
www.sunsetsystems.com