Difference between revisions of "OpenEMR Multiple Sites Module"

From OpenEMR Project Wiki
 
(42 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==Overview==
The Multi site module allows creation of Multiple OpenEMR installations from one codebase footprint (note that each OpenEMR installation does have it's own MySQL database). The instance specific files are stored in the openemr/sites/<installation-name> directory. So, for example, the 'default' installation specific files can be found at openemr/sites/default.
Very cool module that allows creation of Multiple OpenEMR installations from one codebase footprint (note that each OpenEMR installation does have it's own MySQL database, though). The instance specific files are stored in the openemr/sites/<installation-name> directory. So, for example, the 'default' installation specific files can be found at openemr/sites/default.


==Installation of a new site==
==Installation of a new site==
:These instructions are assuming you have already installed OpenEMR (the default site).
:These instructions are assuming you have already installed OpenEMR (the default site).
:*Go to http://<your_server_name_or_IP_address>/openemr/admin.php
:*Note you will need to assign read/write permissions to the openemr/sites directory for your web server
:*Also note your web server will need permission to view the following files (in many installations, access to these files is restricted for security purposes):
::*admin.php and setup.php
::*Also note you need to do a couple things in the setup.php script to build your multisites (set the $allow_multisite_setup and  to ‘true’ and also set $allow_cloning_setup to 'true' if you intend to clone a site) and you should revert those changes right after you are done for security purposes; actually, it's even better to delete the setup.php script completely when you are done building your multisites
::*To avoid permission checking across your new site files and folders which could take lots of time, you can set $checkPermissions in your setup.php file to false
:*Go to <nowiki>https://<your_server_name_or_IP_address>/openemr/admin.php</nowiki>
:*Click 'Add New Site'
:*Click 'Add New Site'
::*Note you will need to assign read permission so the openemr/sites directory
:*Go through the setup step, like a new installation.
:*Go through the setup step, like a new installation.
::*At Step 2, note the two additional options:
::*At Step 2, note the two additional options:
Line 14: Line 17:
==Upgrading==
==Upgrading==
:*If only upgrading the 'default' site, then just need to follow the [[OpenEMR_Upgrade_Guides| standard OpenEMR upgrading instructions]] for your operating system.
:*If only upgrading the 'default' site, then just need to follow the [[OpenEMR_Upgrade_Guides| standard OpenEMR upgrading instructions]] for your operating system.
:*If also upgrading other sites, then need to consider the following issues also:
:*If also upgrading other sites, then need to do the following:
::*Move all directories for each site
::*Move all directories for each site
:::*openemr/sites/<site_name>/documents
:::*openemr/sites/<site_id>/documents
:::*openemr/sites/<site_name>/edi
:::*openemr/sites/<site_id>/edi
:::*openemr/sites/<site_name>/era
:::*openemr/sites/<site_id>/era
:::*openemr/sites/<site_name>/letter_templates
:::*openemr/sites/<site_id>/letter_templates
::*Configure the openemr/sites/<site_name>/sqlconf.php file for each site
::*Configure the openemr/sites/<site_id>/sqlconf.php file for each site
:::*Copy variables from the old sqlconf.php to the new one
:::*Copy variables from the old sqlconf.php to the new one
:::*Set the $config variable to $config=1;
:::*Set the $config variable to $config=1;
::*Open admin.php in web browser (<nowiki>http://<server_name>/openemr/admin.php</nowiki>)
::*Open admin.php in web browser (<nowiki>http://<server_name>/openemr/admin.php</nowiki>), note see above for admin.php security
:::*If displayed, click 'Upgrade Database' for each site (and follow instructions)
:::*If displayed, click 'Upgrade Database' for each site (and follow instructions)
::*Update the ACL access controls for each site:
:::*<nowiki>http://<server_name>/openemr/acl_upgrade.php?site=<site_id></nowiki>


==Patches==
==Patches==
:*If only installing the patch for the 'default' site, then just need to follow the [[OpenEMR_Patches| standard OpenEMR patch installation instructions]] for your operating system.  
:*If only installing the patch for the 'default' site, then just need to follow the [[OpenEMR_Patches| standard OpenEMR patch installation instructions]] for your operating system.  
:*If also upgrading other sites, then need to consider the following issues also:
:*If also upgrading other sites, then in addition to above, also need to do the following:
::*Open admin.php in web browser (http://<server_name>/openemr/admin.php)
::*Open admin.php in web browser (<nowiki>http://<server_name>/openemr/admin.php</nowiki>)
:::*If displayed, click 'Patch Database' for each site (and follow instructions)
:::*If displayed, click 'Patch Database' for each site
::::* Note this feature will be added to the next 4.1.0 patch release (comment date is 10/23/11)


The Basic premise is the system looks at the URL to determine the site being accessed. If a parameter "site=xxx" is specified, then xxx is taken as the site IDOr if the hostname (e.g. clinic1.example.com) matches an existing site ID, that is used.  Otherwise if the session variable "site_id" exists, that is used. If all else fails "default" is used.  After it is determined, the session variable "site_id" is set accordingly.
==Backup/Restore==
:Backup and restore has some new and interesting behavior. Each site is still backed up individually, and the backup script is careful to omit the site-specific directories of other sitesThe restore script has a new option to specify the site ID being restored, and when the target OpenEMR directory already exists it will preserve that directory and restore only the site-specific subdirectory. Note there is no feature at this time to back up multiple sites at once.


There is a new script "admin.php" to facilitate adding new sites as well as doing database upgrades of existing sites. It has no built-in access control, so it's wise to specify access permissions for it in the web server configuration. admin.php is not required - setup.php, sql_upgrade.php, etc. may still be run independently as before.


Backup and restore has some new and interesting behavior. Each site is still backed up individually, and the backup script is careful to omit the site-specific directories of other sites. The restore script has a new option to specify the site ID being restored, and when the target OpenEMR directory already exists it will preserve that directory and restore only the site-specific subdirectory. Note there is no feature at this time to back up multiple sites at once.
[[Category:User Guide 4.2.0]][[Category:User Guide 4.1.2]][[Category:User Guide 4.1.1]][[Category:User Guide 4.1.0]][[Category:User Guide]][[Category:Configuration Guide]][[Category:Installation]][[Category:Upgrade]][[Category:Patch]][[Category:Backup]]

Latest revision as of 02:08, 3 December 2022

The Multi site module allows creation of Multiple OpenEMR installations from one codebase footprint (note that each OpenEMR installation does have it's own MySQL database). The instance specific files are stored in the openemr/sites/<installation-name> directory. So, for example, the 'default' installation specific files can be found at openemr/sites/default.

Installation of a new site

These instructions are assuming you have already installed OpenEMR (the default site).
  • Note you will need to assign read/write permissions to the openemr/sites directory for your web server
  • Also note your web server will need permission to view the following files (in many installations, access to these files is restricted for security purposes):
  • admin.php and setup.php
  • Also note you need to do a couple things in the setup.php script to build your multisites (set the $allow_multisite_setup and to ‘true’ and also set $allow_cloning_setup to 'true' if you intend to clone a site) and you should revert those changes right after you are done for security purposes; actually, it's even better to delete the setup.php script completely when you are done building your multisites
  • To avoid permission checking across your new site files and folders which could take lots of time, you can set $checkPermissions in your setup.php file to false
  • Go to https://<your_server_name_or_IP_address>/openemr/admin.php
  • Click 'Add New Site'
  • Go through the setup step, like a new installation.
  • At Step 2, note the two additional options:
  • Source site (pick a site to copy the configuration files from)
  • Clone Source Database (if want to clone the database of a already existent site)

Upgrading

  • Move all directories for each site
  • openemr/sites/<site_id>/documents
  • openemr/sites/<site_id>/edi
  • openemr/sites/<site_id>/era
  • openemr/sites/<site_id>/letter_templates
  • Configure the openemr/sites/<site_id>/sqlconf.php file for each site
  • Copy variables from the old sqlconf.php to the new one
  • Set the $config variable to $config=1;
  • Open admin.php in web browser (http://<server_name>/openemr/admin.php), note see above for admin.php security
  • If displayed, click 'Upgrade Database' for each site (and follow instructions)
  • Update the ACL access controls for each site:
  • http://<server_name>/openemr/acl_upgrade.php?site=<site_id>

Patches

  • If only installing the patch for the 'default' site, then just need to follow the standard OpenEMR patch installation instructions for your operating system.
  • If also upgrading other sites, then in addition to above, also need to do the following:
  • Open admin.php in web browser (http://<server_name>/openemr/admin.php)
  • If displayed, click 'Patch Database' for each site

Backup/Restore

Backup and restore has some new and interesting behavior. Each site is still backed up individually, and the backup script is careful to omit the site-specific directories of other sites. The restore script has a new option to specify the site ID being restored, and when the target OpenEMR directory already exists it will preserve that directory and restore only the site-specific subdirectory. Note there is no feature at this time to back up multiple sites at once.