While attempting to upgrade from openemr 3.2.0-1 to 4.1.0-1 on ubuntu 10.04, I managed to break 4.1.0-1. Now I can neither remove or reinstall it. The error message tells me that: "cannot remove/upgrade the package because openemr is not installed at /var/www.
How can I resolve this?
I managed to uninstall openemr 4.1.0-1 and reinstall it. During installation, I was told that it found and successfully connected to my pre-existing openemr database. However, when I opened openemr, I couldn't see any of my patient records.
Then I tried to restore a backup made with version 3.2.1-1 but I got an error message: something about some files not existing.
I then uninstalled version 4.1.0-1 again and tried to reinstall 3.2.1-1, but I got another error: it cannot install because an openemr database already exists!
It's a fine mess. What can I do to get out of it?
If you got the above error(in first post), then nothing should of happened and it should of aborted the upgrade altogether; this is because it did not find the /var/www/openemr directory. Did you try OpenEMR after this error; if so, it should of simply taken you to your original 3.2 version? Or was this after doing a successful 4.1 upgrade?
Best to clearly show what steps you have done.
Also, can you copy/paste the following files here:
And, do you have any /tmp/openemr-tmp/ directories; if so, then list them here?
And, what do you see when type following at command line:
sudo dpkg -s openemr
Thanks for your help.
The first step was this that of an apparently successful upgrade. During installation, I was told that it found and successfully connected to my pre-existing openemr database. However, when I opened openemr, I couldn't see any of my patient records. I then tried to uninstall, but was met with the error message "cannot remove the package because openemr is not installed at /var/www". There might have been some intermediate actions, but I can't remember what if any.
#(currently empty, plan to use in subsequent versions of OpenEMR)
# (DO NOT EDIT below!!!)
Sat Feb 4 09:58:37 CET 2012: MySQL 'openemr' database already exists
Sat Feb 4 09:58:37 CET 2012: EXITING……….
Sat Feb 4 10:00:13 CET 2012: MySQL 'openemr' database already exists
Sat Feb 4 10:00:13 CET 2012: EXITING……….
Sat Feb 4 10:03:09 CET 2012: Configuring package…
Sat Feb 4 10:03:09 CET 2012: Installing OpenEMR
Sat Feb 4 10:03:21 CET 2012: Passed the mysql check loop
Sat Feb 4 10:03:45 CET 2012: Will install OpenEMR, however will not automatically configure OpenEMR. (MySQL database already exists)
Sat Feb 4 10:03:52 CET 2012: Will install OpenEMR, however will not automatically configure OpenEMR. (MySQL user already exists)
Sat Feb 4 10:03:52 CET 2012: Installing OpenEMR …
Sat Feb 4 10:03:52 CET 2012: Configuring Apache for OpenEMR
Sat Feb 4 10:04:04 CET 2012: Added entries to apache configuration to secure directories with patient information.
Sat Feb 4 10:04:04 CET 2012: Placed backup of your original apache configuration file to /etc/apache2/httpd.conf.BAK
Sat Feb 4 10:04:04 CET 2012: Done configuring Apache
Sat Feb 4 10:04:04 CET 2012: Configuring PHP for OpenEMR
Sat Feb 4 10:04:05 CET 2012: Your PHP configuration is perfect for OpenEMR.
Sat Feb 4 10:04:05 CET 2012: Done configuring PHP
Sat Feb 4 10:04:05 CET 2012: Restarting Apache service
* Restarting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
… waiting …apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Sat Feb 4 10:04:25 CET 2012: You can now configure OpenEMR by browsing to:
Sat Feb 4 10:04:25 CET 2012: http://localhost/openemr
Sat Feb 4 10:04:25 CET 2012: See the openemr man page for further instructions:
Sat Feb 4 10:04:25 CET 2012: type 'man openemr' at command line
Sat Feb 4 10:44:06 CET 2012: You have chosen to not install the OpenEMR package.
Sat Feb 4 10:44:06 CET 2012: EXITING……….
Sat Feb 4 10:45:15 CET 2012: Unable to upgrade from .. version package with raw method, so can not upgrade the OpenEMR Package.
Sat Feb 4 10:45:15 CET 2012: EXITING……….
No /tmp/openemr-tmp/ directories are present.
sudo dpkg -s openemr gives:
Status: install ok not-installed
if you go to openemr in your browser, what happens?
It appears you did following maybe:
2) something wrong with upgrade, so removed package, which will delete everything (and I mean everything). However, I bet your old database is still there.
3) When installed 4.1.0 package, the database was there, so it didn't configure it for you.
4) The hope is that you can now:
- configure new openemr install to install into a new database
- then point the sites/default/sqlconf.php config into the old database
- then may need to run the sql_upgrade.php script and acl_upgrade.php script to upgrade the old database from 3.2.0 to new
What will help now is if you have anything at /var/www/openemr and then what happens when you go to openemr in your browser. Also, not sure if openemr package is installed (confused by install ok not-installed), and am wondering if there is any other output after that.
Yes, I have the directory (with subdirectoris and files) at /var/www/openemr.
If I go to localhost/openemr in my browser I get the login interface. I can log in but I cannot see my patient data.
Two things then:
1) type 'sudo mysql'
2) type 'show databases;' (paste what is shown here)
3) type 'exit'
Then look at the file library/sqlconf.php in your previous 3.1.0 backup and what is the $dbase variable set to.
First of all, sorry. I said "I can log in but I cannot see my patient data." This is not true (I remembered this from a previous point in the whole process). But now, when I try to login to my openemr, I get the following text in the browser:
**ERROR: insert failed: insert into log ( date, event, user, groupname, success, comments, crt_user) values ( NOW(), 'login','admin','Default','1','success: ::1','')
Error: Unknown column 'success' in 'field list'**
Second, your queries:
robert@robert-laptop:~$ sudo mysql
password for robert:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
robert@robert-laptop:~$ show databases
The program 'show' is currently not installed. You can install it by typing:
sudo apt-get install nmh
(N.B. I have run sudo apt-get install nmh as instructed, it installed successfully, I have rebooted, but I still get the above!)
// MySQL Config
// Referenced from sql.inc
$host = 'localhost';
$port = '3306';
$login = 'openemr';
$pass = 'G64WiuKPLE5h';
$dbase = 'openemr';
//Added ability to disable
//utf8 encoding - bm 05-2009
$disable_utf8_flag = false;
$sqlconf = array();
$sqlconf = $port;
$sqlconf = $login;
$sqlconf = $pass;
$sqlconf = $dbase;
//////DO NOT TOUCH THIS///
$config = 1; /////////////
This likely means that you need to upgrade your database.
point a browser to
for more details refer to
These pages you directed me to give 404 Not Found:
I already followed the instructions for Ubuntu on:
Failing all else, can anybody please tell me how to purge my system completely of openemr, including the database, so that I can reinstall version 3.2 from scratch. At least that was working and I have a backup which I can restore.
Sorry for not being clear enough
You are meant to replace ubuntu/webserver in the URLs I posted with 127.0.0.1
These are upgrade/administrative pages of OpenEMR. they will give you more information about your own system.
That's brilliant! Problem solved by upgrading my database with http://127.0.0.1/openemr/sql_upgrade.php. I can now log in and see my client data. Many thanks yehster and Brady, you've both been great.
Also need to do:
1) acl_uprade via http://127.0.0.1/openemr/acl_upgrade.php
and copy over directories from your old 3.2 install to your new install:
/openemr/documents (COPY TO) => openemr/sites/default/documents
/openemr/edi (COPY TO) => openemr/sites/default/edi
/openemr/era (COPY TO) => openemr/sites/default/era
/openemr/custom/letter_templates (COPY TO) => openemr/sites/default/letter_templates
Thanks. Will do.
I currently have a debian (squeeze) linux box running openemr 4.1.1. I want to migrate to another box with Debian 7 (wheezy) where I would like to install openeemr 4.1.2.
could you please summarize for me steps to make this transition - I have made a few attempts to install and transfer to the new box, but it is all a right old mess. My original box with 4.1.1 is safe and sound and is the production server.
thanks for the suggestions - couple of clarifications:
2. mysqldump - when you say 'place it in the new box' - do you mean simply extracting the file and copying it to /var/lib/mysql? Or do you mean using the mysql create database command to create 'openemr' database, create openemr mysql user and then importing the dump into this new db?
I now have an additional problem - after I messed up the 4.1.2 install in the new box, I tried to purge remove it - but only after I deleted the /sites/default directory. I am now unable to remove package or even re-install it. Any suggestions?
Use the mysql 'mysqldump' command to create a .sql file of your database:
(don't copy things from var/lib/mysql since may not be compatible if change mysql versions)
"using the mysql create database command to create 'openemr' database, create openemr mysql user and then importing the dump (.sql file) into this new db"
to clean the package from your new 4.1.2 box, yank:
and then yank the openemr mysql database
and then do the following to manually remove a ubuntu/debian package:
(I have not tried this method before; in ubuntu I generally just yank the openemr entry from file described here: http://itechlog.com/linux/2008/12/18/fix-broken-package-ubuntu/ )
then should be ok to use the 4.1.2 package to install/upgrade.
Thanks a lot!
that mysql restore was successful - thanks for your help.
Do you have any experience with similarly transferring the couchdb (ver 0.11.0) database to a new box (couchdb ver 1.2.1).
Any suggestions welcome
I have no experience with couchdb upgrade/transfer. Suggest a google search or perhaps somebody else can weigh in.
Under the WIKI pages I put a link to: Remove Open-EMR in Ububtu if you are really desperate. Please ADD/CHANGE information if needed.
General WIKI Pages 2.21 at the end.
I Recommend instead making a link in Installation Guides section on wiki called "OpenEMR Uninstall Guides" to a new wiki page and placing the information on that page.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.