Difference between revisions of "OpenEMR Multiple Sites Module"
From OpenEMR Project Wiki
(Remove informal language / unnecessary comment + remove subheading so as to create lead section) |
|||
Line 8: | Line 8: | ||
:*Give the newly created directory writable permission for the webserver so that it can create additional directories as needed | :*Give the newly created directory writable permission for the webserver so that it can create additional directories as needed | ||
:*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): | :*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 | ::*admin.php and setup.php | ||
::*Also note you need to do a couple things in the setup.php script to build your multisites and you should revert those changes right after you are done or else your site will be vulnerable to critical security vulnerabilities; actually, its even better to delete the setup.php script completely when you are done building your multisites, https://github.com/openemr/openemr/blob/master/setup.php#L29-L37 | ::*Also note you need to do a couple things in the setup.php script to build your multisites and you should revert those changes right after you are done or else your site will be vulnerable to critical security vulnerabilities; actually, its even better to delete the setup.php script completely when you are done building your multisites, https://github.com/openemr/openemr/blob/master/setup.php#L29-L37 | ||
:*Go to <nowiki>http://<your_server_name_or_IP_address>/openemr/admin.php</nowiki> | :*Go to <nowiki>http://<your_server_name_or_IP_address>/openemr/admin.php</nowiki> |
Revision as of 23:38, 27 November 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
- 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 on this line https://github.com/openemr/openemr/blob/master/setup.php#L203
- Create a directory in openemr/sites, you can use any preferred name for your new sites directory e.g <your_other_clinic_name>
- Give the newly created directory writable permission for the webserver so that it can create additional directories as needed
- 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 and you should revert those changes right after you are done or else your site will be vulnerable to critical security vulnerabilities; actually, its even better to delete the setup.php script completely when you are done building your multisites, https://github.com/openemr/openemr/blob/master/setup.php#L29-L37
- Go to http://<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
- If only upgrading the 'default' site, then just need to follow the standard OpenEMR upgrading instructions for your operating system.
- If also upgrading other sites, then need to do the following:
- 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.