Edjet LMS Server 6.4

Upgrading Edjet LMS Server

This article explains in detail how to upgrade Edjet LMS Server using semi-automatic upgrade process.

Article outline:

Introduction

You can only upgrade to Edjet LMS Server 6.4 from Edjet LMS Server 5.3.

In this tutorial we will stop users coming to an old environment, backup everything, prepare a new environment, migrate all user data, verify upgrade, switch domain to new environment and open a new environment to the users.

This scenario assumes 2 environments:

  • Old environment -- this is your current production environment (server) with an old version of the Edjet LMS Server
  • New environment -- this is your future production environment (server) with a new LMS version

Also, the installation address of LMS installations in both environments is the same. If the address should be different, see how to change installation address.

Rollback options

If anything goes wrong, the old environment is always ready in production state and you can re-open it anytime to users.

The backup of the old environment can be used in case of an human error or other circumstances, causing a damage the old environment.

Upgrade on the Windows server

This procedures was tested with a Windows Server 2016 and Windows Server 2019. These are minimal steps, if your concern is to minimize the downtime, see the recommendations below.

Let's assume the LMS installation directory is "C:\Apache24\htdocs\" for both old and new environments.

Before doing any other steps, create a full backup of your old environment (server).

On the old environment:

  1. Stop the webserver service (restrict access to LMS users so nobody can write any new data):
    run cmd.exe as an Administrator and execute:
    c:\Apache24\bin\httpd.exe -k stop
  2. Dump the LMS database to c:\db_dump.sql file:
    run cmd.exe as Administrator and execute:
    c:\PostgreSQL\bin\pg_dump.exe -U template_c6 -d learnis -f c:\db_dump.sql
    You can open the dump file with any text editor and check it's content.

You will need the db dump data later on.

On the new environment:

  1. Setup new environment for your platform: Linux, Windows Server.
  2. Install a fresh copy of the Edjet LMS Server (new version).
  3. Copy LMS database dump from Old environment to New environment to: C:\db_dump.sql
  4. Copy LMS folder "repository" (contains all user files - Media Library uploads) from Old environment "C:\Apache24\htdocs\repository" to New environment to "C:\Apache24\htdocs\repository" (overwrite existing folder)
  5. Use SQL database manager and connect to PostgreSQL.
  6. Create new database named "elms" (encoding UTF-8, owner template_c6) -- params of the created db are part of the installation tutorial
  7. Restore old database from dump to a newly created database "elms" as user "template_c6" -- run cmd.exe as Administrator and execute:
    c:\PostgreSQL\bin\psql.exe -U template_c6 -d elms -f "C:\db_dump.sql
    Warning about "public" scheme can be ignored
  8. Download PostgreSQL DB update 2022-01-17-update_5-3-1_6-4-23.zip.
  9. Unzip the archive to "C:\".
  10. Run PostgreSQL DB update in new database "elms" as user "template_c6":
    c:\PostgreSQL\bin\psql.exe -U template_c6 -d elms -f "C:\2022-01-17-update_5-3-1_6-4-23.sql"
  11. Switch application to use an updated database "elms":
    • Open config file "C:\Apache24\htdocs\config\cfg.ini.php".
    • Change "dbname" to "elms" and save the file.
  12. Now you can browse the app and activate the Edjet LMS using your license key.

Upgrade on the Linux server

We are working in this tutorial.

Minimizing the downtime

If your priority is to minimize the downtime during the upgrade, here are some recommendations. In general you can stop the webserver after the new environment is ready and tested and just get fresh database dump and fresh copy of the repository folder.

This procedure let's you also test the upgrade process safely and without time pressure, which is always a good idea anyway.

In the first part of the procedure there is no downtime yet:

  1. Dump the LMS database on the old environment.
  2. Setup a new environment (server).
  3. Setup temporarily routing of the domain DNS on the new environment (use "hosts" file for example).
  4. Install Edjet LMS to a new environment.
  5. Copy database dump, create a new database and restore the database to a new environment.
  6. Download and run database update on the new environment.
  7. Copy LMS folder "repository" from old to new environment.
  8. Activate the Edjet LMS using new license key.
  9. Test and verify the new installation.

The above steps might take some time, especially when done for the first time.

After the upgrade verification, if the status is satisfactory, you can carry on with the final steps where a short downtime is necessary.

The second part of the procedure require the downtime but can only take couple of minutes to proceed. So the downtime length will be probably determined by the DNS TTL of your domain. In most cases, you can expect 15-30 minutes to update the DNS of the sub-domain to the end users.

Check the TTL value of your domain before you begin (it can be anything from 600 s to 48 hrs) to plan around it.

Steps:

  1. Drop the database scheme on the new environment
  2. Stop the webserver on both environments. <-- DOWNTIME BEGIN
  3. Update domain DNS to new environment.
  4. Dump the fresh LMS database on the old environment.
  5. Copy database dump and restore the database to a new environment.
  6. Run database update on the new environment
  7. Copy LMS folder "repository" from old to new environment.
  8. Start the webserver on new environment. <-- DOWNTIME END

At this point the new LMS is opened to the users. Some users might experience longer downtime due to DNS caching.

Limitations

Upgrade process has some limitations. In general, no customizations are migrated. This include and is not limited to:

  • Custom or customized scripts.
  • Database customizations or optimizations.
  • Overrides of system data (config files, localization strings).
  • Theme customization.

All customizations must be migrated separately after the upgrade.

Installation and upgrade