Skip to main content

Restore

Caution

The restore procedure physically destroys your current LogicalDOC installation first, and only after that it tries to restore the data from your backup.

Because of this delicate matter, we strongly suggest you to carefully plan such an action and in case of doubts please contact the support service.

To restore data from a previous backup, open a console in the installation folder of the backup tool and type the following command:

Windows:

restore.bat

Linux and OSX:

restore.sh

Restore up to a certain date

Instead of restoring all from the beginning until the last backup, you can restore the system up to a given date just by specifying it using the ISO format yyyy-MM-dd(eg. 2020-09-27):

Windows:

restore.bat 2020-09-27

Linux and OSX:

restore.sh 2020-09-27

Execute as Administrator user

On Windows the restore procedure must be launched from a command window as Administrator because it has to interact with system services. In particular, the recovery procedure stops the LogicalDOC process in order to properly restore the data. At the end of the restore procedure the LogicalDOC service will be automatically restarted.

Backup

To start the backup open a command console, navigate to the installation folder of LogicalDOC Backup and type the following command:

Windows:

backup.bat

Linux and Mac:

backup.sh

Product of backup

The backup tool produces a number of sub-folders. So we will have a tree of subfolders in which each node represents the product of the backup of a specific resource. Depending on the type of resource the tool runs a specific and suitable backup in particular:

configuration incremental, single .zip file
plugins incremental, single .zip file
user preferences incremental, single .zip file
index image, single .zip file
database delta, multi .zip files
storage incremental, multi .zip files

Storage space for backups

To back up LogicalDOC you must have a disk with at least 80% of the disk space occupied by the documents in LogicalDOC.

Backup Installation

The LogicalDOC Backup needs to be installed in the same server that is running your LogicalDOC.

Download and launch the installation package for your system from the download website.

During the setup you will be prompted to provide the folder where your LogicalDOC is installed in and the target folder that will receive the backup packages.

Configuration

The installer configures the backup tool with common settings, but you can change them at any time by editing the configuration file located at <Backup_Home>/conf/context.properties:

ParameterDescription
logicaldoc.homeFull path of LogicalDOC installation directory 
backup.targetdirFull path of the directory that will receive the backup files 
db.usernameThe username to connect to the database
db.passwordThe password to connect to the database
db.host

Hostname or IP address of the database. Default value: localhost

db.port

Database port. Default value: 3306 for MySQL, 5342 for PostgreSQL

db.name

Database name. Default value: logicaldoc

backup.db.dirAbsolute path of the temporary folder that will receive the database dumps
backup.db.command

Full path of the database dump command. Default value: mysqldump for MySQL, pg_dump for PostgreSQL

backup.db.arguments

Arguments to pass to the dump command.

Default value for MySQL: -h ${db.host} -P ${db.port] -u ${db.username} -p${db.password} ${db.name}

Default value for PostgreSQL: -h ${db.host} -p ${db.port} -U ${db.username} -d ${db.name}

backup.db.data.command

Full path of the database command to extract the data. Default value: mysqldump for MySQL, pg_dump for PostgreSQL

backup.db.data.arguments

Arguments to pass to the data dump command.

Default value for MySQL: -h ${db.host} -P ${db.port} -u ${db.username} -p"${db.password}" --tab ${backup.db.dir} ${db.name}

Default value for PostgreSQL: -h ${db.host} -p ${db.port} -U ${db.username} -d ${db.name}

restore.db.commandFull path of the database restore command. Default value: mysql for MySQL, psql for PostgreSQL
restore.db.arguments

Arguments to pass to the restore command.

Default value for MySQL: -h ${db.host} -P ${db.port] -u ${db.username} -p${db.password} ${db.name} 

Default value for PostgreSQL: -h ${db.host} -p ${db.port} -U ${db.username} -d ${db.name}

restore.db.data.command

Full path of the database command to restore the data. Default value: mysqlimport for MySQL, psql for PostgreSQL

restore.db.data.command

Full path of the database command to restore the data. Default value: mysqlimport for MySQL, psql for PostgreSQL

restore.db.data.arguments

Arguments to pass to the data restore command.

Default value for MySQL: -h ${db.host} -P ${db.port} -u ${db.username} -p"${db.password}" -i --ignore-foreign-keys=true --use-threads=4 ${db.name} 

Default value for PostgreSQL: -h ${db.host} -p ${db.port} -U ${db.username} -d ${db.name}

restore.db.data.arguments

Arguments to pass to the data restore command.

Default value for MySQL: -h ${db.host} -P ${db.port} -u ${db.username} -p"${db.password}" -i --ignore-foreign-keys=true --use-threads=4 ${db.name} 

Default value for PostgreSQL: -h ${db.host} -p ${db.port} -U ${db.username} -d ${db.name}

MySQL Secure File Priv

The LogicalDOC Backup must export your data into the temporary folder configured in the setting backup.db.dir, but if you are using MySQL or MariaDB, there is the configuration variable secure-file-priv used to limit the effect of data import and export operations. These operations are permitted only to users who have the FILE privilege on the specified path. 

In order to make the LogicalDOC Backup able to extract your data, please uncomment the variable secure-file-priv in your my.ini or my.cnf configuration file and set it to empty string or to the same path specified in the backup.db.dir:

secure-file-priv = ""

-- or --

secure-file-priv = "same path of backup.db.dir"

Log of the application

The backup tool sends its output to the console. It also creates execution log files in the logs folder. Inside this folder, the system will write the log of the backup activities. A new log file will be generated each time the backup command is executed.

Receive backup reports by Email

The LogicalDOC Backup can send to a list of recipients a report with the result of each elaboration. This keeps you updated on the status of the backup of your system without the need to periodically inspect the logs.

To allow the tool to send you the email reports, just connect it to an SMTP server in <Backup_Home>/conf/context.properties:

BACKUP SETTINGS FOR EMAIL
Parameter Description
smtp.enabled Put true if you want to receive the report by email
smtp.host Hostname or IP address of the SMTP server
smtp.port Port to connect to the SMTP server
smtp.username The username to connect to the SMTP server
smtp.password The password to connect to the SMTP server
smtp.sender Email address used as the sender of the reports
smtp.recipient Comma-separated list of email addresses that will receive the reports
 

 

LogicalDOC Backup

LogicalDOC Backup is an optional component that can be installed if you need a dedicated backup solution for your documents repository.

The main features of the LogicalDOC Backup module are:

  • Archive compression and encryption
  • Suitable for large documents repositories
  • Storage on local hard drive, network drive, USB key, FTP or SFTP server
  • Incremental, differential and full backup support
  • Support for delta backup
  • All processes are transactional (this guarantees your backups' integrity)
  • Command-line interface
  • Email activity report
  • Multi-Platform support: Windows, Unix, Linux, Mac OSX