Sql_upgrad error

(Clif Caldwell) #1

I will not bore you with the issue. The bottom line is that the database had be rebuild from about a 4.0.0 level due to lack of a working back up of mysql/data.

Eventually imported an old mysql back up structure (probably 4.0.0) into openemr. Extracted 5.0.0 but could not get the sql_upgrade to work so used 5.0.2 since the 5.0.0-5.0.1 issue (according to many posts here) seemed to have worked.
Copied documents folder over (should be noted that this is a newer copy as the openemr/sites/default/documents were from a working 5.0.0 version, put in the correct credentials in the openemr/sites/default/sqlconf.php file.
When running the sql_upgrade it stops cold with:

Notice: Undefined index: translate_no_safe_apostrophe in C:\xampp\htdocs\openemr\library\translation.inc.php on line 50
Notice: Undefined index: translate_no_safe_apostrophe in C:\xampp\htdocs\openemr\library\translation.inc.php on line 50
Fatal error: Uncaught PDOException: SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘openemr.version’ doesn’t exist in
C:\xampp\htdocs\openemr\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php:88 Stack trace: #0
C:\xampp\htdocs\openemr\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\PDOConnection.php(88): PDO->query(‘SELECT t0.v_maj…’) #1
C:\xampp\htdocs\openemr\vendor\doctrine\dbal\lib\Doctrine\DBAL\Connection.php(908): Doctrine\DBAL\Driver\PDOConnection->query(‘SELECT t0.v_maj…’) #2
C:\xampp\htdocs\openemr\vendor\doctrine\orm\lib\Doctrine\ORM\Persisters\Entity\BasicEntityPersister.php(904): Doctrine\DBAL\Connection->executeQuery(‘SELECT t0.v_maj…’, Array, Array) #3
C:\xampp\htdocs\openemr\vendor\doctrine\orm\lib\Doctrine\ORM\EntityRepository.php(181): Doctrine\ORM\Persisters\Entity\BasicEntityPersister->loadAll(Array, NULL, NULL, NULL) #4
C:\xampp\htdocs\openemr\vendor\doctrine\orm\lib\Doctrine\ORM\EntityRepository.php(164): Doctrine\ORM\EntityRepository->findBy(Array) #5 C:\xampp\htdocs\open in
C:\xampp\htdocs\openemr\vendor\doctrine\dbal\lib\Doctrine\DBAL\Driver\AbstractMySQLDriver.php on line 42

Obviously at this point I have no idea. If someone has a better plan please let me know or some idea how to get the sql_upgrade.php to execute I am all ears.


(Stephen Waite) #2

hi @Clif_Caldwell, so you’re trying to restore an old backup into 5.0.2?

(Clif Caldwell) #3

Yes. I was able to get the database populated at ~4.1.0 level and accidently called the sql_patch from 5.0.0 which did something. When I realized that I had not called up the sql_upgrade script I went back to do this and received what you see. I still can redo the database at the 4.1.0 level if need be THEN try the sql_upgrade script. In fact tomorrow after church that is what I was going to do.
Question: if I get it up to a 5.0.2 level will it see the data in the documents folder without the necessary mysql/data folder that should correspond to that newer documents directory?

(Stephen Waite) #4

prob not, your situation is similar to Ubuntu 14.4 End Of Life and OpenEMR