[Mayan EDMS: 286] Simple script for remote Mayan EDMS backup

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Mayan EDMS: 286] Simple script for remote Mayan EDMS backup

rosarior
Administrator
Just a simple bash script I use to backup the Mayan installation at work to my laptop.  It creates a sub directory based on the date under the MOUNT_POINT you specify after that does a complete database and document storage copy.


#!/bin/sh
MOUNT_POINT=/home/rosarior/data_disk/ogpe-backup/mayan/backups
MAYAN_SERVER=172.16.1.196
DATE=`date +%Y%m%d`
BACKUP_DIRECTORY="$MOUNT_POINT/$DATE"
REMOTE_SSH_USERNAME=rosarior
REMOTE_MYSQL_USERNAME=root
REMOTE_MYSQL_DATABASE=mayan

echo "Backup directory: $BACKUP_DIRECTORY"
mkdir -p $BACKUP_DIRECTORY

echo -n  "Running mysqldump..."
mysqldump --host=$MAYAN_SERVER -u $REMOTE_MYSQL_USERNAME -p $REMOTE_MYSQL_DATABASE > $BACKUP_DIRECTORY/mayan.sql
echo "mysqldump finished."

echo -n "Running rsync..."
rsync -avz --delete --progress -e ssh $REMOTE_SSH_USERNAME@$MAYAN_SERVER:/var/local/mayan/document_storage/ $BACKUP_DIRECTORY/document_storage/
echo "rsync finished."

echo "Backup complete."

--
 
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Mayan EDMS: 363] Re: Simple script for remote Mayan EDMS backup

mayan_firsttime
cool but would be great if you could incorporate this feature to mayan itself

--
 
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Mayan EDMS: 376] Re: Simple script for remote Mayan EDMS backup

rosarior
Administrator
I am working on a backup app with a few planned features including remote backups (https://github.com/rosarior/mayan/tree/development/apps/backups), but it depends on experimental stuff not present in the current so it will be a while before inclusion into the stable version.

--Roberto

On Thursday, November 15, 2012 4:48:26 AM UTC-4, mayan_firsttime wrote:
cool but would be great if you could incorporate this feature to mayan itself

--
 
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Mayan EDMS: 1384] Re: Simple script for remote Mayan EDMS backup

Subhash Pant
In reply to this post by rosarior
Roberto,

I am trying to configure two mayan servers, on ditto hardware. My backup/restore goals are as follows:

1) Keep a backup of everyday diffs into a separate place, includes MySQL and document_storage.
2) Copy the backups from primary to secondary, and overwrite the MySQL Db, as well as document_ storage so that I have a hot standby available.

Do you see any configuration issues with this? basically, on secondary, i intend to overwrite everything everyday, maybe in rename_mayan Db, create new mayan db and restore on top of it.

I also have another question. In the previous versions of Mayan, I was able to access the files using path in the indexes, as defined in the settings_local. But it appears that the feature has been deprecated. Is there any way I can decrypt, or extract files out of my document storage if I ever need to?

Thanks.
--Subhash

On Thursday, September 27, 2012 at 11:13:48 AM UTC-5, Roberto Rosario wrote:
Just a simple bash script I use to backup the Mayan installation at work to my laptop.  It creates a sub directory based on the date under the MOUNT_POINT you specify after that does a complete database and document storage copy.


#!/bin/sh
MOUNT_POINT=/home/rosarior/data_disk/ogpe-backup/mayan/backups
MAYAN_SERVER=172.16.1.196
DATE=`date +%Y%m%d`
BACKUP_DIRECTORY="$MOUNT_POINT/$DATE"
REMOTE_SSH_USERNAME=rosarior
REMOTE_MYSQL_USERNAME=root
REMOTE_MYSQL_DATABASE=mayan

echo "Backup directory: $BACKUP_DIRECTORY"
mkdir -p $BACKUP_DIRECTORY

echo -n  "Running mysqldump..."
mysqldump --host=$MAYAN_SERVER -u $REMOTE_MYSQL_USERNAME -p $REMOTE_MYSQL_DATABASE > $BACKUP_DIRECTORY/mayan.sql
echo "mysqldump finished."

echo -n "Running rsync..."
rsync -avz --delete --progress -e ssh $REMOTE_SSH_USERNAME@$MAYAN_SERVER:/var/local/mayan/document_storage/ $BACKUP_DIRECTORY/document_storage/
echo "rsync finished."

echo "Backup complete."

--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Mayan EDMS: 1402] Re: Simple script for remote Mayan EDMS backup

rosarior
Administrator


On Friday, June 10, 2016 at 9:33:29 PM UTC-4, Subhash Pant wrote:
Roberto,

I am trying to configure two mayan servers, on ditto hardware. My backup/restore goals are as follows:

1) Keep a backup of everyday diffs into a separate place, includes MySQL and document_storage.
2) Copy the backups from primary to secondary, and overwrite the MySQL Db, as well as document_ storage so that I have a hot standby available. 

Do you see any configuration issues with this? basically, on secondary, i intend to overwrite everything everyday, maybe in rename_mayan Db, create new mayan db and restore on top of it.


I would suggest than instead of copying the MySQL DB you do an sql dump and load instead, higher changes the backup will be good. 
 
I also have another question. In the previous versions of Mayan, I was able to access the files using path in the indexes, as defined in the settings_local. But it appears that the feature has been deprecated. Is there any way I can decrypt, or extract files out of my document storage if I ever need to?


The feature was re-added as a filesystem in userspace (FUSE).   Documentation here: http://mayan.readthedocs.io/en/latest/topics/indexes.html#mirroring

execute ./manage.py mountindex [index-slug] [target directory]. Now all your index structure will be available at [target directory].

 
Thanks.
--Subhash

On Thursday, September 27, 2012 at 11:13:48 AM UTC-5, Roberto Rosario wrote:
Just a simple bash script I use to backup the Mayan installation at work to my laptop.  It creates a sub directory based on the date under the MOUNT_POINT you specify after that does a complete database and document storage copy.


#!/bin/sh
MOUNT_POINT=/home/rosarior/data_disk/ogpe-backup/mayan/backups
MAYAN_SERVER=172.16.1.196
DATE=`date +%Y%m%d`
BACKUP_DIRECTORY="$MOUNT_POINT/$DATE"
REMOTE_SSH_USERNAME=rosarior
REMOTE_MYSQL_USERNAME=root
REMOTE_MYSQL_DATABASE=mayan

echo "Backup directory: $BACKUP_DIRECTORY"
mkdir -p $BACKUP_DIRECTORY

echo -n  "Running mysqldump..."
mysqldump --host=$MAYAN_SERVER -u $REMOTE_MYSQL_USERNAME -p $REMOTE_MYSQL_DATABASE > $BACKUP_DIRECTORY/mayan.sql
echo "mysqldump finished."

echo -n "Running rsync..."
rsync -avz --delete --progress -e ssh $REMOTE_SSH_USERNAME@$MAYAN_SERVER:/var/local/mayan/document_storage/ $BACKUP_DIRECTORY/document_storage/
echo "rsync finished."

echo "Backup complete."

--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Mayan EDMS: 1410] Re: Simple script for remote Mayan EDMS backup

Bruno CAPELETO
In reply to this post by rosarior
Hi strongly suggest not incorporating backup strategy to MAYAN itself.

Please make clear in the documentation what to be backuped (sql dump + document folder) and how to recover in case of a crash, in order to implement that in a global (per user) strategy.

For incremental backup I personnaly use customized scripts based on rdiff-backup.


Le jeudi 13 décembre 2012 02:08:26 UTC+1, Roberto Rosario a écrit :
I am working on a backup app with a few planned features including remote backups (<a href="https://github.com/rosarior/mayan/tree/development/apps/backups" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Frosarior%2Fmayan%2Ftree%2Fdevelopment%2Fapps%2Fbackups\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEYIzXfY6jDQP1HwcxhFFo0zzzwtQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Frosarior%2Fmayan%2Ftree%2Fdevelopment%2Fapps%2Fbackups\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEYIzXfY6jDQP1HwcxhFFo0zzzwtQ&#39;;return true;">https://github.com/rosarior/mayan/tree/development/apps/backups), but it depends on experimental stuff not present in the current so it will be a while before inclusion into the stable version.

--Roberto

On Thursday, November 15, 2012 4:48:26 AM UTC-4, mayan_firsttime wrote:
cool but would be great if you could incorporate this feature to mayan itself

--

---
You received this message because you are subscribed to the Google Groups "Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...