Moving a site

gutiersa wrote on Monday, December 05, 2011:

Hello

freebsd7.1
apache22
php5.2

I have upgraded from 3.2 to 4.1.0_4 successfully (finally).

Now I am trying to move a previously separate installation of openemr, from another office, into its own sites folder.
I am following the instructions as a new install, but using the new site name.

I can get to up to step 3, then it breaks. This is the output:

"
Step 3

Configuring OpenEMR…

Connecting to MySQL Server… OK.
Creating database… OK.
Creating user with permissions for database… OK.
Reconnecting as new user… OK.
Creating Main tables… OK
Creating Language Translation (utf8) tables… OK
Creating CVX Immunization Codes tables… OK
Writing SQL configuration…  unable to open configuration file for writing: /link-to/openemr/library/classes/…/…/sites/newsite/sqlconf.php

creating a new site in my test set up (windows with xampp1.7.3). But that was not really moving a site.
I am stuck, and in my live system

please help.

sandra

gutiersa wrote on Monday, December 05, 2011:

BTW:

I have checked all permissions and they are correct.
I can even modify the sqlconf.php  file from another computer, same location as server, and save the changes.
the file is already world writable and owner and group are www:www

sandra

What am I doing wrong?

penguin8r wrote on Wednesday, December 07, 2011:

Sounds like an interesting project.
Are you trying to create an empty new database & then restore your existing site DB back over it or what?
Are the database names the same?
Any additional information you can give might be the clue someone needs to solve your problem.

gutiersa wrote on Wednesday, December 07, 2011:

Yes, I was trying to setup a new emr with a site name, and then move the other office’s info into sites/other-office-emr,
then populate the new database with the backup of the other-office-emr database.

Since I have 3 separate installations, I figured upgrades would be easier. Specially since i have several files that I customized.

However as soon as I finished runing setup.php and the new sites/other-office-emr, had been created my already default practice stopped responding. Issues with “no site indicated” or something, and then just hung upon loging off, or trying to log back in

by the way, the sites/other-office-emr folder ended up inheriting all the default site’s documents.

I ended up having to start from scratch with a brand new openemr4.1.0_4 installation,
creating my initial(default) site with its original name of openemr, instead of using default at the setup.php screen, that way the subsequent sites would have fresh documents folder.

I made the appropriate file changes as per instructions, and then uploaded the database backup.

It was pretty tough because my original installation has been upgraded with new releases. Upgrades and new installs have differences. A lot of things don’t work but I have been fixing stuff thru the day. mostly with the database.
I should have dropped the complete new empty database, then ran my prev. openemr.sql with creating the old database with my data.

By the way. to do this, whichever sited is getting migrated, the version of openemr must be up to date. otherwise uploading prev data won’t work, and replacing database with old data will cause conflicts in the program. Also I would not know how to run sql_upgrade.php, etc, etc, while indicating site name.

I tried that just now, but it did not give me the option of which site to update, I’m not even gonna try sql_upgrades.php (or sql_patches, or sql_upgrades for that matter).

I have learned my lesson.

Sandra

tmccormi wrote on Wednesday, December 07, 2011:

Sandra,
   If you have a multiple site setup using the URL https://myhostname/openemr/admin.php  gives you a nice list of the sites and their current state, ie: needs setup, needs upgrade or login.

Tony
www.mi-squared.com / @tonymi2
oemr.org / @OEMR_org

bradymiller wrote on Wednesday, December 07, 2011:

In addition to Tony’s comment, as of the 4.1.0(4), patching multiple site setups is also very simple:
http://open-emr.org/wiki/index.php/OpenEMR_Multiple_Sites_Module#Patches

-brady

gutiersa wrote on Wednesday, December 07, 2011:

BTW.

with the new sites system, if u log out of openemr, the resulting link is

https://address/openemr/interface/login/login_frame.php             (no site indicated)

as per the literature, the program will default to the default site, which in my case has remained as a default site template for the other installations (ie: to avoid inheriting documents, edi’s and era’s from some default office)
Hence when trying to re-login to openemr, it defaults to /site/default, which has an $config = 0 value, which then redirects to setup.php.

The latter is pretty open (not protected by userId and password). In an untrained office employee’s hands, it can lead to trouble if he/she keeps hitting continue buttons.

What I did was set $config = 1 in /sites/default/sqlconf.php manually. In the future if I need another site, I just set it to $config = 0 to run set up, then re-edit manually

I think this is a bug:

when logging off openemr, the remaining browser link needs to be:

https://address/openemr/interface/login/login_frame.php?site=openemr

not the former. Not everyone will know to click the correct link again, instead of loging into the same resulting screen.

gutiersa wrote on Wednesday, December 07, 2011:

OH:

In my defense, I did look for adding site instructions, but I have still not reviewed the whole wiki site. I did not find them.
It would have saved me a lotta trouble

bradymiller wrote on Wednesday, December 07, 2011:

Hi,

In addition to setup.php, there are several scripts that I think would be good to remove/secure after an install to avoid bad things from happening, which are listed here:
http://open-emr.org/wiki/index.php/Securing_OpenEMR#OpenEMR

Also for the wiki, always feel free to ask if looking for documentation. There’s been a real push over the last several months to document everything, and it’s very helpful to know where the documentation is still lacking (ie. if you ask and it does not yet exist).

Rec. placing the above logout issue in the bug tracker; should be an easy fix.

-brady

gutiersa wrote on Wednesday, December 07, 2011:

Yes I have found the documentation to be very good. I am just always getting myself in trouble, and having little to repair

gutiersa wrote on Wednesday, December 07, 2011:

Hi again

when installing the new site from admin.php I am getting this error

‘Failed creating tables. Please enable DEBUG mode (set it to TRUE in $gacl_options near top of admin/gacl_admin.inc.php) to see the error and try again. You will most likely need to delete any tables already created.’

none of the gacl tables are created, and I could not figure out how to set debug to true

I can’t access that site yet

sandra