shihjay2 / nosh-in-a-box

NOSH in a Box is a self-contained virtual machine that deploys NOSH ChartingSystem, an EHR coded by a physician for physicians
26 stars 13 forks source link

Database import failure #7

Closed rumsant closed 6 years ago

rumsant commented 6 years ago

Testing out the ability to import a database to a new nosh-in-a-box. Exported database from current machine. Unzipped the exported file, and attempted to import the included .sql file into a brand new machine two separate times. Both times I end up with the same error: screenshot from 2018-09-11 19-06-40

If I am trying to migrate my current nosh-in-a-box database to a new computer, is there a different way I should be doing it? P.S. This error occurs after I try to log in with the main physician user.

shihjay2 commented 6 years ago

For now on the current machine, https://../nosh/backup

SSH into the current machine and look for an .sql in /noshdocuments and save it where you can access it on the new NOSH instance (like your laptop). I would also copy all directories and files in the /noshdocuments directory with the exception of the /nosh2 directory.

In the new NOSH machine (install a fresh instance), login as admin and click on Database -> Import Database from File and upload the .sql file you just saved. Then paste all the directories and files into the /noshdocuments directory that you copied earlier from the current NOSH machine.

rumsant commented 6 years ago

There is no .sql file in /noshdocuments

shihjay2 commented 6 years ago

Did you run the https://.../nosh/backup - the response should be a blank screen when complete and an *.sql file (noshbackup_1536725368.sql for example) should be present.

rumsant commented 6 years ago

No I didn't run the backup. That was my problem.

rumsant commented 6 years ago

As far as I can tell that worked.

The way I had initially tried to do this involved using the .sql file that was in the "nosh" folder on the host machine. I am assuming these .sql backups are being created automatically by nosh-in-a-box, correct? Because I see that it is done every day. Is the reason that using that .sql didn't work was because I failed to also restore the files/folders from /noshdocuments?

Unconnected question: I found that during installation there is no longer a dialogue asking to create a password for the database (MariaDB/MySQL), instead it just spits out a long string of numbers/letters and tells you that this is your MariaDB password. I saved it, but I just wanted to be sure it was in fact the way things are supposed to work.

shihjay2 commented 6 years ago

Yes, it is likely when you did not restore the files and folders from /noshdocuments that it will error out because it is looking for files associated in the database that no longer exist.

Yes, that was an update to help make it easier for patients (who use NOSH for the patient centered logitudinal health record) and providers who install NOSH in the Box to not need to remember the mysql password; I also hardened the security to not install phpmyadmin since there is a low likelihood that a less advanced user would need to get access to the database in that way. If you ever do need to find out the password to the database, you can find it in the /noshdocuments/nosh2/.env file.