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¶
- First, a backup directory must be created. For the next steps, it will be refered as <backup_directory>.
- Stop Tomcat.
STEP 2. Backup your settings¶
Backup your context file¶
- Go to the installation directory of Tomcat.
- Go to the directory path_to_tomcat_directory/conf/Catalina/localhost.
- 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¶
- Go to the directory configured in the log4j2FilePath parameter.
- Copy the log4j2.xml file defined into the <backup_directory>.
Backup your add-ons configuration¶
- Go to the directory configured in the pluginsPropertiesDirectory parameter.
- Archive all the folders, subfolders, and files with a recursive zip or gzip command.
- Copy the archive into the <backup_directory>.
STEP 3. Backup your assets¶
- Go to the directory configured in the assetDirectory parameter.
- Archive all the folders, subfolders and files with a recursive zip or gzip command.
- 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.
Open a terminal window in <backup_directory>.
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.
Open a terminal window in <backup_directory>.
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¶
Open a terminal window in <backup_directory>.
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¶
- Go to the <backup_directory>.
- 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¶
- Go to the <backup_directory>.
- Copy the file log4j2.xml file into the directory defined in the configuration log4j2FilePath parameter.
Restore your add-ons configuration¶
- Go to the <backup_directory>.
- Extract the add-ons configuration archive into the directory defined in the configuration pluginsPropertiesDirectory parameter.
STEP 3. Restore your assets¶
- Go to the directory configured in the assetDirectory parameter.
- Delete the content of that directory to clean before restoring the assets backup.
- Go to the <backup_directory>.
- 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:
Open the liquibase directory
Open the directory corresponding to your database server (e.g mariadb, mysql, oracle)
Edit the liquibase.properties file
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.
Open a terminal window in the the liquibase directory.
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.
Open a terminal window in the <backup_directory>.
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
When the import operation is over, restart Tomcat.
Connect to the platform administration interface, and navigate to SETTINGS/Jobs.
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.
Open a terminal window in the the liquibase directory.
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.
Open a terminal window in the <backup_directory>.
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
When the import operation is over, restart Tomcat.
Connect to the platform administration interface, and navigate to SETTINGS/Jobs.
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.
Open a terminal window in the the liquibase directory of the iObeya version you tried to install.
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.
Open a terminal window in the <backup_directory>.
Execute sqlplus with the SYSTEM user and in the prompt type the SYSTEM password of the database.
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
When the import operation is over, restart Tomcat.
Connect to the platform administration interface, and navigate to SETTINGS/Jobs
Launch manually the job RebuildIndexTasks.