EN  FR

Backup, restore and migration guide

Once you've installed Jorani you might wonder what are the location of the data and important files. Whether you want to restore Jorani after the loss of your server or if you want to migrate to another server, this article explains what are the most important information to backup.

Additional tips about MySQL and phpMyAdmin will be explained as well as the most common errors and how to solve them.

Where is the data?

Important files

Configuration files

Let's have a look into the configuration folder:

  • The various configuration files of Jorani

    Structure of Jorani configuration files

You may have noticed that it contains a main folder and two sub-folders: demo and testing. By default, the files of the parent folder (application/config) are used. But you can switch to another folder by editing the .htaccess file as follow:

  • SetEnv CI_ENV=development will instruct the application to use the configuration files contained into application/config/development/.
  • SetEnv CI_ENV=testing will instruct the application to use the configuration files contained into application/config/testing/.
  • SetEnv CI_ENV=production will instruct the application to use the configuration files contained into application/config/production/.
  • If the CI_ENV environment variable is not set, the configuration files contained into application/config will be used.

If you are using nginx, you need to add a new fastcgi_param entry as in this example:

  location / {
     fastcgi_param CI_ENV  testing;
  }

We saw that the location of configuration files may varies depending on the setup. And it is a good idea to backup the configuration files, but only these files:

  • config.php contains the general configuration of the application.
  • email.php contains the email configuration.
  • database.php contains the database configuration.
  • saml.php contains the SAML configuration. SAML is a protocol used in transparent login scenarios (SSO for Single Sign On). In this case, Jorani relies on another application to proove the identity of the user.

You should not backup and restore the other files (eg. routes.php, constants.php, etc.). As these files are part of the base code of the application. Restoring an older version of these files on a new version of the base code may cause unexpected behavior.

Sometimes new parameters are added into the configuration file. So you should read carefully each release note and report the new parameters. Even if Jorani is robust enough to work with default values if it cannot find the new parameters into the configuration file.

Local triggers and reports

The folder local (at the root of the installation) is used by people wanting to modify the behaviour of Jorani:

  • With software triggers when a Leave or overtime request is created.
  • With custom reports.

If you have created custom code, you should obviously backup and restore these files.

Database

The database must be fully backed up. Which implies to back up the custom procedures used by Jorani. Indeed Jorani SQL model includes procedures (also called functions or routines) and cannot work without them.

If you back up the database from the command line, you should not forget the routine flag:

  mysqldump --routines -u jorani_user -p jorani_db > jorani_db.sql

If you back up the database from phpMyAdmin, you must export structure and data. Default options or Quick method are OK.

If the procedures are no more into the database, you may use this file to restore them.

Troubleshooting

One of the most common error occuring after an unsuccesful backup/restore is that the list of employees is no more working. A JavaScript alert would display the message below and the list of employees is empty.

  DataTables warning: table id=users - Ajax error. For more information about this error, please see http://datatables.net/tn/7
  Unexpected Ajax Error
  • The list of employees cannot be displayed

    Error in HR / Employees

Another error with a related cause may appear on the global calendar that displays an Unexpected Ajax Error.

In both cases, the same root cause is that the procedures were not created into the database. You should use this file to restore them. Either by importing the file or with the SQL tab of phpMyAdmin (or from the command line).

A good practise after a fresh installation or a database restore is to browse the database from phpMyAdmin. All tables and procedures must be present as in the picture below:

  • Check that routines, procedures, functions and tables are present

    Database ckeck after a backup and restore


Tags :    page 
 

You may also like

Activating Google analytics js tracking code

This article explains how to activate the Google analytics tracking code and to optionally trace the user ID.   Read »

How to request a leave?

How to create and submit your first leave request? How to send it to your line manager for approval?   Read »

How to manage ermployees?

The list of employees page allows HR officer and manager to manage the leave, overtime and entitled days of employees.   Read »

Login to Jorani application

Once your account has been created, you can login to the application. This article explains how to solve connection problems.   Read »

Audit the leave requests of your employees

If you use LMS in order to prepare the payroll, as with a paper-based process, you need to regularly audit the leave requests of your employees.   Read »

comments powered by Disqus