DocCyblade / tkl-mayan-edms

Turnkey Linux - Mayan EDMS
https://www.turnkeylinux.org/mayan-edms
Other
4 stars 12 forks source link

Maybe move user stored data out to /srv/edms-data #21

Closed DocCyblade closed 7 years ago

DocCyblade commented 7 years ago

A symlink could work just point to the new location. Need to know how TKLBAM will handle the symlink on a restore

DocCyblade commented 7 years ago

@JedMeister what can you say to this or point me at some docs regarding symlinks

JedMeister commented 7 years ago

If it's easy enough to actually move the data store location (via config file or something), I would put the docs in a separate place (such as /srv/edms-data or similar). A symlink would probably work fine, and I happily use them for config and log files. But as a general rule, with larger volumes of data I would be inclined to write the data directly to where it's being stored.

If adjusting the storage location is tricky, then you could leave it as is and create a convenience symlink in /srv pointing to the real location. The data is still stored deep in the system, but the symlink makes it easy to get to...

JedMeister commented 7 years ago

Sorry I didn't really answer the question...

AFAIK TKLBAM saves symlinks as symlinks (i.e. doesn't follow them, just includes them). So the location they point to needs to also be part of the backup set if you want that data included. Although TBH I'm not 100% on that and am not aware of any docs.

DocCyblade commented 7 years ago

Sounds good

DocCyblade commented 7 years ago

To do this we need to :

In the conf.d/main:


# Make doc store in /srv
mkdir -p /srv/edms-data/document_storage

cat << EOF > $APP_DB_TEMPLATE
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': '$DB_NAME',
        'USER': '$DB_USER',
        'PASSWORD': '$DB_PASS',
        'HOST': 'localhost',
        'PORT': '5432',
    }
}

BROKER_URL = 'redis://127.0.0.1:6379/0'
CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379/0'

STORAGE_FILESTORAGE_LOCATION = '/srv/edms-data/document_storage'

EOF

...

# Make the installation and directory readable and writable by the webserver user
chown www-data:www-data /usr/share/mayan-edms -R
chown www-data:www-data /srv/edms-data -R
DocCyblade commented 7 years ago

completed with latest commit, was easy to do just changed it in the config file that gets created