Etendo Backup and Restore Plugin
Overview
This article explains how to use the Etendo Backup and Restore plugin in Etendo Classic. This plugin allows you to easily generate and restore Etendo backups.
Install plugin
To use the Etendo Backup and Restore tool, you should add the plugin id on the build.gradle file, with the selected version.
Info
To know the available versions of the plugin, please visit the Release Notes.
To resolve the plugin dependiencies, you should add the following lines on top of the settings.gradle file
pluginManagement {
repositories {
maven {
url 'https://maven.pkg.github.com/etendosoftware/com.etendoerp.etendobackup'
credentials {
username "${githubUser}"
password "${githubToken}"
}
}
mavenCentral()
}
}
Warning
Make sure you have your Github credentials (githubUser and githubToken) set in the gradle.properties file.
Backup task
To run the backup, execute
Where the mode could be manual or auto. If the parameter is not specified, the default mode is manual.
Backup properties file
The backup.properties file is found inside the config folder on the root project.
If it does not exists, run ./gradlew setup to generate the missing files.
You can also provide a custom location of backup.properties adding the next block inside build.gradle.
backup.properties contains most of the properties that you should customize before running the backup.
-
USERSets the user who will be running the backup. -
GROUPSets the group related to the user running the backup. -
BACKUPS_DIRSets the path where the backup will be stored.Warning
Ensure that the directory where the backups will be stored is already created and that the configured user has write permissions on it.
-
BACKUPS_TMP_DIRSets the path where the temp directory will be created to store the generated files. -
ATTACH_COPYSets a flag (yesorno) if the external attachments (if cointained) should be included in the backup. -
ATTACH_IN_BKPSets a flag (yesorno) if the source attachments should be included in the backup.
Email properties
These properties are used when the backup is running in auto mode.
EMAIL_FROMSets the address sending emails.EMAIL_SERVERSets the email server address.EMAIL_PORTSets the port for the email server..EMAIL_USERSets the user address who sends emails.EMAIL_PASSWORDSets the email user password.EMAIL_ENVIRONMENTSpecifies the environment for sending emails.
Depending on the end STATE, the following properties are used to specify the email address where to send emails.
Error
EMAIL_ERROR_TOSets the email address where error emails will be sent.EMAIL_ERROR_CCSets the email address to which copies (CC) will be sent in case of error.EMAIL_ERROR_SUBJECTSets the subject of the error email.
Warning
SEND_EMAIL_ON_WARNINGSpecifies whether to send an email notification in case of warning during the backup process. Accepted values areyesorno.EMAIL_WARNING_TOSets the email address where warning emails will be sent.EMAIL_WARNING_CCSets the email address to which copies (CC) will be sent in case of warning.EMAIL_WARNING_SUBJECTSets the subject of the warning email.
Success
SEND_EMAIL_ON_SUCCESSSpecifies whether to send an email notification in case of success during the backup process. Accepted values areyesorno.EMAIL_WARNING_TOSets the email address where success emails will be sent.EMAIL_WARNING_CCSets the email address to which copies (CC) will be sent in case of success.EMAIL_WARNING_SUBJECTSets the subject of the success email.
Note
In order to send the email to multiple accounts, separate addresses with ;.
For example: EMAIL_ERROR_CC=user1@etendo.software;user2@etendo.software
End states
The following are the possible states at the end of the backup task:
Error
Occurs when the creation of the backup fails. An email must be sent to the specified properties.
Warning
The backup ends with warning messages. If the SEND_EMAIL_ON_WARNING flag is set to yes, an email should be sent to the specified properties.
Success
The backup ends without warning or errors. If the SEND_EMAIL_ON_SUCCESS flag is set to yes, an email should be sent to the specified properties.
Restore task
Warning
The user running the restore should have SUDO access.
To run the restore, execute
Replace /path/to/backup/ with the location of the backup to be restored.
A menu will be shown where you can choose multiple options to be performed.
Warning
Make sure all the options selected are correct. The selected destination directories and database will be OVERWRITTEN.
-
User verification
You should run the restore withSUDOaccess (recommended). In case of not having permissions, you will have the option of inserting theSUDOpassword. -
Sources destination
You can select the location in which the sources will be restored. The default path is set to the root dir from the project where the restore command is being executed. -
Attachments verification
You can select to keep or ignore the copy of attachments (externals or contained inside the sources). -
Properties verification
You can select which properties to use.Info
The properties set the options which the database will use on the restore.
-
Project properties
Obtained from thegradle.propertiesfile inside the current project running the restore. You can change these properties to select, for example, the name of the database to be restored. Once the restore is done, the properties insideconfig/Openbravo.propertieswill be updated with the selected ones. -
Original sources properties
Obtained from thegradle.propertiesfile inside the original sources. The database will be restored with the original options (this could overwrite an existing database) The properties insideconfig/Openbravo.propertieswill not change.
-
-
Database properties
In the end, a message will be shown with the properties which the database will use to be restored. These properties depend on the ones selected previously.
This work is licensed under CC BY-SA 2.5 ES by Futit Services S.L..