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.

Tip

If you want to create a pre-production environment replicating your production data, you should first install the version you run in your production on a new server following the standard Installation Guide. Once your new instance is up and running, you can then execute the following procedure to create a backup of your production data and restore it on your new instance. Beware, you will have to contact our Support team (support@iobeya.com) to obtain a pre-production license by providing the server ID of your new instance.

Backup your iObeya data

STEP 1. Prerequisites

  1. First, a backup directory must be created. For the next steps, it will be refered as <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 path_to_tomcat_directory/conf/Catalina/localhost.
  3. Copy the context file (ex: ROOT.xml or iobeya.xml depending on the name given when you installed iObeya) that contains the iObeya configuration parameters into the <backup_directory>.

Note

For the next steps, refer to the context file you backed up for each mentioned parameter.

Backup your Log4j2 configuration file

  1. Go to the directory configured in the log4j2FilePath parameter.
  2. Copy the log4j2.xml 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

Make sure your Tomcat server is stopped.

Backup your MySQL 8.0 database

Note

During the iObeya installation procedure a dedicated database named iobeya is created. If you changed the database name during the installation process, you will have to adapt accordingly the database name in the following cammands. Replace <DATABASE_ADDRESS> and <DATABASE_NAME> by the values configured in the context file deployed on your running instance.

  1. Open a terminal window in <backup_directory>.

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

    mysqldump --column-statistics=0 -h <DATABASE_ADDRESS> -u root -p --databases <DATABASE_NAME> > iobeyadump.sql
    

    Example:

    mysqldump --column-statistics=0 -h localhost -u root -p --databases iobeya > iobeyadump.sql
    

Backup your MariaDB database

Note

During the iObeya installation procedure a dedicated database named iobeya is created. If you changed the database name during the installation process, you will have to adapt accordingly the database name in the following cammands. Replace <DATABASE_ADDRESS> and <DATABASE_NAME> by the values configured in the context file deployed on your running instance.

  1. Open a terminal window in <backup_directory>.

  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> > iobeyadump.sql
    

    Example:

    mysqldump -h localhost -u root -p --databases iobeya > iobeyadump.sql
    

Backup your Oracle database

  1. Open a terminal window in <backup_directory>.

  2. Run the following command, providing 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
    

Note

If either the username or password is omitted, the export command will prompt you for it.

Restore your iObeya data

STEP 1. Prerequisites

Make sure your 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 he context file (ex: ROOT.xml or iobeya.xml depending on the name given when you installed iObeya) into the path_to_tomcat_directory/conf/Catalina/localhost directory.

Note

For the next steps, refer to the context file you restored for each mentioned parameter.

Restore your Log4j2 configuration file

  1. Go to the <backup_directory>.
  2. Copy the file log4j2.xml file into the directory defined in the configuration log4j2FilePath parameter.

Restore your add-ons configuration

  1. Go to the <backup_directory>.
  2. Extract the add-ons configuration archive into the directory defined in the configuration pluginsPropertiesDirectory parameter.

STEP 3. Restore your assets

  1. Go to the directory configured in the assetDirectory parameter.
  2. Delete the content of that directory to clean before restoring the assets backup.
  3. Go to the <backup_directory>.
  4. Extract the assets archive into the directory defined in the configuration assetDirectory parameter.

STEP 4. Restore your database

Starting with iObeya version 4.20, Liquibase (https://docs.liquibase.com/) is used to version control the iObeya database schema. Liquibase is an open-source database-independent library for tracking, managing, and applying database schema changes. It provides a way to apply changes to the database in a consistent and trackable manner.

Liquibase directory structure

In the iObeya packages you’ve downloaded you will find a Liquibase directory containing the following files and directories:

  • iobeya-sql-changelog.jar (the Liquibase changesets package containing all the changes to initialize the iObeya database)
  • mysql
    • mysql-connector-java.jar (the JDBC driver for MySQL)
    • liquibase.properties (Liquibase configuration file preconfigured for MySQL)
  • mariadb
    • mariadb-java-client.jar (the JDBC driver for MariaDB)
    • liquibase.properties (Liquibase configuration file preconfigured for MariaDB)
  • oracle
    • ojdbc8.jar (the JDBC driver for Oracle)
    • liquibase.properties (Liquibase configuration file preconfigured for Oracle)

Liquibase configuration

First, you will have to edit the preconfigured liquibase.properties file corresponding to your database server to provide the information that Liquibase needs to connect.

Warning

Even if it’s possible, we strongly recommend that you do not include authentication information in your liquibase.properties file. You can use instead command line arguments to provide sensitive credentials using environment variables for instance.

From the root directory of the iObeya packages:

  1. Open the liquibase directory

  2. Open the directory corresponding to your database server (e.g mariadb, mysql, oracle)

  3. Edit the liquibase.properties file

  4. Change the following parameters:

    • liquibase.command.url: provide the url and port of your database server

    Warning

    By default, the installation procedure creates a database schema named iobeya. If you changed the database schema name during the installation process, you will have to change this value in the url parameter defined in the liquibase.properties file. Check the value that was configured in the context file deployed on your running instance.

Restore your database on MySQL

Warning

If it already exists, the iObeya database will be automatically deleted before restoring the backup you created. We highly recommend restoring your backup on a pre-production environment to validate the procedure before restoring it on your production.

  1. Open a terminal window in the the liquibase directory.

  2. Run the following command after replacing <DATABASE_USERNAME> and <DATABASE_PASSWORD> by the values configured in the context file you restored. Liquibase is going to clean the iObeya database schema.

    java -jar iobeya-sql-changelog.jar --defaultsFile=mysql/liquibase.properties --username=<DATABASE_USERNAME> --password=<DATABASE_PASSWORD> dropall
    

    At the end of the process you should see the following message:

    Liquibase command 'dropAll' was executed successfully.
    
  3. Open a terminal window in the <backup_directory>.

  4. Run the following command:

    Note

    During the iObeya installation procedure a dedicated database named iobeya is created. If you changed the database name during the installation process, you will have to replace accordingly <DATABASE_NAME> placeholder in the following cammand.

    mysql -h localhost -u root -p <DATABASE_NAME> < iobeyadump.sql
    

    Example:

    mysql -h localhost -u root -p iobeya < iobeyadump.sql
    
  5. When the import operation is over, restart Tomcat.

  6. Connect to the platform administration interface, and navigate to SETTINGS/Jobs.

  7. Launch manually the job RebuildIndexTasks.

Restore your database on MariaDB

Warning

If it already exists, the iObeya database will be automatically deleted before restoring the backup you created. We highly recommend restoring your backup on a pre-production environment to validate the procedure before restoring it on your production.

  1. Open a terminal window in the the liquibase directory.

  2. Run the following command after replacing <DATABASE_USERNAME> and <DATABASE_PASSWORD> by the values configured in the context file you restored. Liquibase is going to clean the iObeya database schema.

    java -jar iobeya-sql-changelog.jar --defaultsFile=mariadb/liquibase.properties --username=<DATABASE_USERNAME> --password=<DATABASE_PASSWORD> dropall
    

    At the end of the process you should see the following message:

    Liquibase command 'dropAll' was executed successfully.
    
  3. Open a terminal window in the <backup_directory>.

  4. Run the following command:

    Note

    During the iObeya installation procedure a dedicated database named iobeya is created. If you changed the database name during the installation process, you will have to replace accordingly <DATABASE_NAME> placeholder in the following cammand.

    mysql -h localhost -u root -p <DATABASE_NAME> < iobeyadump.sql
    

    Example:

    mysql -h localhost -u root -p iobeya < iobeyadump.sql
    
  5. When the import operation is over, restart Tomcat.

  6. Connect to the platform administration interface, and navigate to SETTINGS/Jobs.

  7. Launch manually the job RebuildIndexTasks.

Restore your Oracle database

Warning

If it already exists, the iObeya database will be automatically deleted before restoring the backup you created. We highly recommend restoring your backup on a pre-production environment to validate the procedure before restoring it on your production.

  1. Open a terminal window in the the liquibase directory of the iObeya version you tried to install.

  2. Run the following command after replacing <DATABASE_USERNAME> and <DATABASE_PASSWORD> by the values configured in the context file you restored. Liquibase is going to clean the iObeya database schema.

    java -jar iobeya-sql-changelog.jar --defaultsFile=oracle/liquibase.properties --username=<DATABASE_USERNAME> --password=<DATABASE_PASSWORD> dropall
    

    At the end of the process you should see the following message:

    Liquibase command 'dropAll' was executed successfully.
    
  3. Open a terminal window in the <backup_directory>.

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

  5. On the sqlplus prompt, run the following command after replacing the <SYSTEM_PASSWORD> for the user SYSTEM:

    imp userid=system/<SYSTEM_PASSWORD> file=export_iobeya_full.dump log=import_iobeya_full.log FROMUSER=IOBEYA TOUSER=IOBEYA
    
  6. When the import operation is over, restart Tomcat.

  7. Connect to the platform administration interface, and navigate to SETTINGS/Jobs

  8. Launch manually the job RebuildIndexTasks.