OpenEMR Multiple Sites Module

From OpenEMR Project Wiki
Revision as of 03:48, 24 October 2011 by Bradymiller (talk | contribs)

Overview

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

These instructions are assuming you have already installed OpenEMR (the default site).
  • Go to http://<your_server_name_or_IP_address>/openemr/admin.php
  • 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.
  • 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

To upgrade the 'default' site, basically just need to follow the standard OpenEMR upgrading instructions for your operating system.

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 ID. Or 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.

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.