Migrating from Windows to Linux folder permission settings

infrastructure
installation

(Sherwin Gaddis) #1

I am really putting this out here for myself and if someone else can use it. Be my guest. It seems I often migrate from Windows to Linux. So, I am posting the folder changes that are needed so I can find them when I need them again.

Run these commands from inside the openemr/.

sudo chmod 666 sites/default/sqlconf.php
sudo chmod 666 interface/modules/zend_modules/config/application.config.php
sudo chmod -R 755 interface/modules/zend_modules/config/application.config.php
sudo chmod 666 interface/modules/zend_modules/config/application.config.php
sudo chmod -R 757 sites/default/documents
sudo chown -R www-data:www-data sites/default/documents
sudo chmod -R 775 sites/default/edi
sudo chown -R www-data:www-data sites/default/edi
sudo chmod -R 775 sites/default/era
sudo chown -R www-data:www-data sites/default/era
sudo chmod -R 775 sites/default/letter_templates
sudo chown -R www-data:www-data sites/default/letter_templates
sudo chmod -R 775 gacl/admin/templates_c
sudo chmod 775 interface/main/calendar/modules/PostCalendar/pntemplates/compiled
sudo chmod 775 interface/main/calendar/modules/PostCalendar/pntemplates/cache

  sudo chown -R www-data:www-data interface/main/calendar/modules/PostCalendar/pntemplates/cache
  sudo chown -R www-data:www-data interface/main/calendar/modules/PostCalendar/pntemplates/compiled

(Jerry P) #2

Hi Sherwin,
Some of the site directory locations have been moved to documents sub in v5.0.2 eg edi, era, certificates and others.

I’m somewhat worried this move may make upgrades from lesser versions a little confusing unless we document it well in upgrade instructions. I’m pretty sure the move is meant to ensure that our backup get these site specific files.


(MD Support) #3

It’s good to have a comprehensive list to go to.

Since these checks are done in setup and list is built in globals, may be setup can be enhanced to recheck these locations to provide list of exceptions and output a .sh file with commands needed to fix the exceptions.

As a safety measure, allow only administrators to run setup script.


(Jerry P) #4

yep. I think for new installs this was addressed very well in new setup but, you’re right, maybe a new utility for upgrades/integrity check would be appropriate.


(Sherwin Gaddis) #5

I didn’t think forward. You are right about the files being moved.

I do run the setup script to make sure I get all the directory permissions correct.

I think that is a good idea to have an admin function to this when moving from windows to Linux.

Alfonzo P. provided the script below.

FixOEMRPermissions.sh (1.0 KB)


(Brady Miller) #6

hi ,
The ubuntu package and dockers will plan to do the dir reorg automatically during upgrade. And for others, instructions for doing the dir reorg will be in the upgrade docs on the wiki.
-brady