Upgrade Lizmap Web Client

Upgrading from Lizmap 2.x

See documentation of Lizmap 3.1.

Upgrading from Lizmap lower than 3.5 versions

You should first migrate to 3.5. See documentation of Lizmap 3.5. Then you could migrate to 3.6.

Upgrading from Lizmap 3.5 with the migration script

Since Lizmap 3.6.2, there is a script lizmap/install/migrate_from_3_5.sh that helps a lot to migrate from Lizmap 3.5. It manipulates lizmap files, and upgrade automatically some additional modules.

Get the Lizmap 3.6 archive by downloading an archive on the release page.

You should then rename the lizmap/ directory of Lizmap 3.5 to lizmap35.bak/ for example:

mv lizmap lizmap35.bak

Then extract the lizmap/ directory from the archive, so it will be become the new lizmap/ directory.

Then launch lizmap/install/migrate_from_3_5.sh by given the path to the previous lizmap directory. Example:

cd lizmap/install
./migrate_from_3_5.sh ../../lizmap35.bak

Then, you can launch the installer

php installer.php -v
sudo clean_vartmp.sh

If there is no error, you should see Lizmap 3.6 in action into your browser. You can then delete lizmap35.bak and lib/ (there is not anymore a lib/ directory into Lizmap 3.6).

If there are some error during the upgrade, and you don’t find a solution, just delete the new lizmap directory, and rename the old lizmap directory.

mv lizmap lizmap36.bak
mv lizmap35.bak lizmap

You can use Lizmap 3.5 again, or try the manual upgrade described below.

Upgrading manually from Lizmap 3.5

Here is how to upgrade from Lizmap 3.5.

Data backup

Backup your data and configuration files into a directory (ex: /tmp) with the lizmap/install/backup.sh script of Lizmap 3.5.

lizmap/install/backup.sh /tmp

If you want to backup by hand, you should backup at least these files:

  • var/db/jauth.db (if it exists)

  • var/db/logs.db (if it exists)

  • var/config/installer.ini.php

  • var/config/liveConfig.ini.php

  • var/config/localframework.ini.php (if it exists)

  • var/config/lizmapConfig.ini.php

  • var/config/localconfig.ini.php

  • var/config/profiles.ini.php

Replace Lizmap files

Get the Lizmap archive by downloading an archive on the release page.

You should then :

  • rename the lizmap/ directory to lizmap.bak/ for example

  • extract the lizmap/ directory from the archive, so it will be become the new lizmap/ directory.

  • execute the script lizmap/install/restore.sh /tmp or reinstall by hand the files you backup.

Note: there is not anymore a lib/ directory.

Updating additional modules

If you installed some modules into lizmap/my-packages or into lizmap/lizmap-modules, you must update them. There are probably new versions for Lizmap 3.6. Read documentation of these modules.

Launch the installer

You have to launch the configurator (it will upgrade some configuration files), and then the installer, which will upgrade some stuff: database tables, data etc..

sudo lizmap/install/clean_vartmp.sh
php lizmap/install/configurator.php
php lizmap/install/installer.php

Cleanup and test

You should then delete all cache and temporary files:

sudo lizmap/install/clean_vartmp.sh

Then you should call the script that sets rights on files. Parameters are the web user and the web group used by the web server to execute Lizmap. On a Debian server, it is often www-data.

sudo lizmap/install/set_rights.sh www-data www-data

Then load Lizmap into your browser, you should see your maps without errors.

If this is the case, you can delete the old directories lib/ and lizmap.bak/.

Migrating from Sqlite to Postgresql

You may have installed Lizmap with Sqlite. You should then have these files lizmap/var/db/jauth.db and lizmap/var/db/logs.db, where some data like users, permissions and logs are stored. And you should have this configuration into lizmap/var/config/profiles.ini.php:

[jdb:jauth]
driver=sqlite3
database="var:db/jauth.db"

[jdb:lizlog]
driver=sqlite3
database="var:db/logs.db"

It you have a such configuration, you can migrate data to a Postgresql database.

First, create a Postgresql database, and then change the configuration into lizmap/var/config/profiles.ini.php, by setting access parameters to the Postgresql database. It is recommended to create a schema into the database, for example lizmap , if it contains already some tables.

For example :

[jdb:jauth]
driver=pgsql
host=localhost
port=5432
database="your_database"
user=my_login
password=my_password
search_path=lizmap,public

[jdb:lizlog]
driver=pgsql
host=localhost
port=5432
database="your_database"
user=my_login
password=my_password
search_path=lizmap,public

See the chapter about installation to know more about these parameters.

Then you can launch these scripts which will migrate the data.

php lizmap/console.php database:migrateusers
php lizmap/console.php database:migratelog

If there are no errors, you can then go onto lizmap with your browser, and check that you can authenticate yourself. You should see also the list of users into the administration panel. If this is the case, you can backup files jauth.db and logs.db and you can delete them.

If something goes wrong and you cannot fix the issue, revert the database access into lizmap/var/config/profiles.ini.php as before, like this :

[jdb:jauth]
driver=sqlite3
database="var:db/jauth.db"

[jdb:lizlog]
driver=sqlite3
database="var:db/logs.db"

And Lizmap should work well, but still with Sqlite.

Upgrading to a minor version of Lizmap 3.6

A new version of Lizmap 3.6 may be released (3.6.1, 3.6.2 etc.). You should upgrade your existing Lizmap 3.6 instance in order to make use of improvements and bug fixes.

Backup

In case the upgrade fail, it is a good thing to backup the entire lizmap directory before doing anything.

cp -a lizmap lizmap.bak

if the upgrade fail, delete the lizmap directory and launch:

mv lizmap.bak lizmap

Replace Lizmap files

Get the Lizmap archive by downloading an archive on the release page.

You can then extract the lizmap/ directory from the archive, it will overwrite all files, except from lizmap/var/.

Launch the installer

You have to launch the configurator (it will upgrade some configuration files if needed), and then the installer, which will upgrade some stuff: database tables, data etc..

sudo lizmap/install/clean_vartmp.sh
php lizmap/install/configurator.php
php lizmap/install/installer.php

Restore the rights on files, by indicating the web user and the web group used by the web server

sudo lizmap/install/set_rights.sh www-data www-data

Then load Lizmap into your browser, you should see your maps without errors.

If this is the case, you can delete the old directory lizmap.bak/.