Operational procedures

Backup and restore

In this section of the guide you will find the steps required to backup and restore iObeya.

If you would like to backup and restore iObeya, you must establish a backup strategy for the following elements:

  • the assets.
  • the configuration files.
  • the database.

Backup

STEP 1. Prerequisites

  1. First, a backup directory must be created. For the next step, it will be named <backup_directory>.
  2. Stop Tomcat.

STEP 2. Backup your settings

Backup your context file
  1. Go to the installation directory of Tomcat.
  2. Go to the directory “<INSTALL_TOMCAT>/conf/Catalina/localhost”.
  3. Copy the iobeya.xml (by default) context file that contains the datasource settings and the iObeya configuration parameters into the <backup_directory>.

Note

For the next steps, refer to each mentioned parameter in the context file.

Backup your Log4j2 configuration file
  1. Go to the directory configured in the log4j2FilePath parameter.
  2. Copy the log4j2.xml (by default) file defined into the <backup_directory>.
Backup your add-ons configuration
  1. Go to the directory configured in the pluginsPropertiesDirectory parameter.
  2. Archive all the folders, subfolders, and files with a recursive ZIP or GZIP command.
  3. Copy the archive into the <backup_directory>.

STEP 3. Backup your assets

  1. Go to the directory configured in the assetDirectory parameter.
  2. Archive all the folders, subfolders and files with a recursive zip or gzip command.
  3. Copy the archive in the <backup_directory>.

STEP 4. Backup your database

Warning

You must have write permissions on the specified directory.

Backup your MySQL/MariaDB database
  1. Open a terminal window.

  2. Run the following command. At the prompt enter the password for the user root:

    mysqldump -h <database_address> -u root -p --databases <database_name> > <backup_directory>/dumpfile.sql
    

    Example:

    mysqldump -h localhost -u root -p --databases iobeya > /var/iobeya/backup/iobeyadump.sql
    
Backup your Oracle database
  1. Open a terminal window.

  2. Run the following command, replace the <system_password> for the user SYSTEM:

    exp userid=system/<system_password> file=/export_iobeya_full.dump log=/export_iobeya_full.log rows=y owner=IOBEYA
    

Restore

STEP 1. Prerequisites

Make sure that Tomcat server is stopped before starting the restore procedure.

STEP 2. Restore your settings

Restore your context file
  1. Go to the <backup_directory>.
  2. Copy the iobeya.xml (by default) context file to the “<INSTALL_TOMCAT>/conf/Catalina/localhost” directory.
Restore your Log4j2 configuration file
  1. Go to the <backup_directory>.
  2. Copy the file log4j2.xml (by default) file into the directory defined in the configuration parameter log4j2FilePath.
Restore your add-ons configuration
  1. Go to the <backup_directory>.
  2. Unzip the add-ons configuration archive into the directory defined in the configuration parameter pluginsPropertiesDirectory.

STEP 3. Restore your assets

Note

Please refer to the context file. If you defined assetStorage=database skip this step.

  1. Go to the <backup_directory>.
  2. Unzip the assets archive into the directory defined in the configuration parameter assetDirectory.

STEP 4. Restore your database

Restore your MySQL/MariaDB database
  1. In your terminal window, log in with the database root user account.

  2. Run the following command:

    mysql -h localhost -u root -p database_name < <backup_directory>/dumpfile.sql
    

    Example:

    mysql -h localhost -u root -p iobeya < /var/iobeya/backup/iobeyadump.sql
    
  3. Restart Tomcat.

Restore your Oracle database
  1. Open a terminal window.

  2. Create a new “iobeya” database and a dedicated “iobeya” user account:

    1. Go into the “iobeya/dbscripts” directory of the installation package.

    2. Execute sqlplus with the SYSTEM user and in the prompt type the SYSTEM password of the database.

    3. On the sqlplus prompt, execute the reinit-iobeya.sql script using the @ followed by the complete path to the script file:

      @<install>\dbscripts\reinit-iobeya.sql
      
    4. On the sqlplus prompt, execute the init-iobeya.sql script using the @ followed by the complete path to the script file:

      @<install>\dbscripts\init-iobeya.sql
      
    5. Quit sqlplus.

  3. Run the following command, replace the <system_password> for the user SYSTEM:

    imp userid=system/<system_password> file=/PATH_TO_BACKUP_DIRECTORY/<backup_directory>/export_iob eya_full.dump log=/var/logs/import_iobeya_full.log FROMUSER=IOBEYA TOUSER=IOBEYA
    
  4. Restart the iObeya server.

  5. Go in the Administration interface, SETTINGS/Jobs

  6. Launch manually the job “RebuildIndexTasks”

Advanced procedures

This section includes detailed procedures for different tasks, such as how to reset the database, launch jobs without using iObeya, etc.

Resetting the database

MySQL/MariaDB procedure

To reset the database, run the reinit-iobeya.sql srcipt.

  1. Open a terminal window.

  2. Go into the dbscript directory of the iObeya installation package directory.

  3. Execute the reinit-iobeya.sql script using:

    mysql -h localhost -u root -p < reinit-iobeya.sql
    

Oracle procedure

To reset the base, run the reinit-iobeya.sql script.

  1. Open a terminal window.

  2. Go into the dbscript directory of the iObeya installation package directory.

  3. Execute sqlplus with the SYSTEM user and type in the prompt of the SYSTEM password in the database.

  4. On the sqlplus prompt, execute the reinit-iobeya.sql script using the @ symbol, followed by the complete path to the script file:

    @<install>\dbscript\reinit-iobeya.sql
    

Warning

All users and databases created by init-iobeya will be deleted.