Aktualizace webového klienta Lizmap
Aktualizace z verze Lizmap 2.x
Aktualizace z verze Lizmap nižší než 3.5
You should first migrate to 3.5. See documentation of Lizmap 3.5.
Upgrading to Lizmap 3.10
Before upgrading to Lizmap 3.10, check these points:
PHP 8.2 is now the minimum version. Upgrade PHP first if needed, read Installing necessary packages.
QGIS Server 3.40 is now the minimum version.
Lizmap configuration files with a target version lower than 3.7 are not displayed anymore on the landing page. They are still listed in the administration panel with a warning. Open them with a recent version of the Lizmap plugin in QGIS desktop and save them again.
The upgrade itself is done with the usual steps described below (backup, replace files, launch the installer).
After the upgrade:
The storage format of the tile cache has changed: the cache directory, or the Sqlite file, of a layer is now named with a hash of the layer name. A cache generated before the upgrade is not used anymore. You must generate the cache again (read Správa mezipaměti jako správce). The old cache is not deleted automatically: you can remove it with the command
php lizmap/console.php wmts:cache:clean repository project, which removes the whole cache of a project, or remove the old directories by hand.Tiles in WebP format are now stored as WebP in the cache (they were stored as JPEG before). If some layers use the WebP format with the server cache, clear their cache.
The installer creates a new
permalinktable, used to store short permalinks (read Short permalink), and a new right Manage server side permalinks for administrators.The user interface now uses Bootstrap 5 instead of Bootstrap 2. If you have written your own JavaScript, CSS themes or templates, check them, read Přidání vlastního JavaScriptu and Vytváření jednoduchých motivů.
For developers of additional modules, some old PHP classes have been removed:
lizmapRepository(use\Lizmap\Project\Repository),lizmapOGCRequest(use\Lizmap\Request\OGCRequest),lizmapProxy(use\Lizmap\Request\Proxy),qgisServerandqgisProject. The classeslizmapProject(use\Lizmap\Project\Project) andlizmapWkt(use\Lizmap\App\WktTools) are deprecated.
Upgrade z verze Lizmap 3.5 nebo 3.6
Here is how to upgrade.
First, you must install PHP and Composer (apt install composer in Debian, or install by hand from https://getcomposer.org ). Then you can start the migration.
Install new sources of Lizmap.
Archiv Lizmap získáte stažením archivu na stránce release.
Pak byste měli :
rename the
lizmap-web-client/directory tolizmap-web-client.bak/for exampleextract files from the archive and rename the
lizmap-web-client-3.10.0directory tolizmap-web-client/, so it replaces the previous installation.
mv lizmap-web-client lizmap-web-client.bak
zip -r lizmap-web-client-3.10.0.zip
mv lizmap-web-client-3.10.0 lizmap-web-client
Migration
Go into the lizmap-web-client/lizmap/install/ directory and execute migrate_from_previous_version.sh.
You must give the path of the old lizmap directory.
cd lizmap-web-client/lizmap/install/
migrate_from_previous_version.sh ../../../lizmap-web-client.bak/lizmap/
It will copy all configuration files and additionnal modules from the old installation, and update these modules.
Spuštění instalačního programu
You have to launch the installer, which will upgrade some stuff: database tables, data etc..
You should stay in the lizmap-web-client/lizmap/install/ directory.
sudo clean_vartmp.sh
php configurator.php
php installer.php
Čištění a testování
Poté byste měli odstranit všechny mezipaměť a dočasné soubory:
sudo clean_vartmp.sh
Pak byste měli zavolat skript, který nastavuje práva k souborům. Parametry jsou webový uživatel a webová skupina, které webový server používá ke spuštění Lizmap. Na serveru Debian je to často www-data.
sudo set_rights.sh www-data www-data
Poté načtěte Lizmap do prohlížeče a mapy by se měly zobrazit bez chyb.
Revert upgrade
- If the new installation does not work, you can restore the old installation, by simply rename the
lizmap-web-client.bak/tolizmap-web-client/
mv lizmap-web-client lizmap-web-client.newbug
mv lizmap-web-client.bak lizmap-web-client
Migrace ze Sqlite na Postgresql
Je možné, že jste nainstalovali Lizmap se Sqlite. Pak byste měli mít tyto soubory lizmap/var/db/jauth.db a lizmap/var/db/logs.db, kde jsou uložena některá data, jako jsou uživatelé, oprávnění a logy. A tuto konfiguraci byste měli mít v lizmap/var/config/profiles.ini.php:
[jdb:jauth]
driver=sqlite3
database="var:db/jauth.db"
[jdb:lizlog]
driver=sqlite3
database="var:db/logs.db"
Pokud máte takovou konfiguraci, můžete data migrovat do databáze Postgresql.
Nejprve vytvořte databázi Postgresql a poté změňte konfiguraci v souboru :lizmap/var/config/profiles.ini.php nastavením přístupových parametrů k databázi Postgresql. Doporučujeme vytvořit do databáze schéma, například lizmap , pokud již obsahuje nějaké tabulky.
Například :
[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
Další informace o těchto parametrech naleznete v kapitole o instalaci.
Poté můžete spustit tyto skripty, které provedou migraci dat.
php lizmap/console.php database:migrateusers
php lizmap/console.php database:migratelog
Pokud se neobjeví žádné chyby, můžete pomocí prohlížeče přejít na lizmap a zkontrolovat, zda se můžete ověřit. Měli byste také vidět seznam uživatelů v panelu administrace. Pokud tomu tak je, můžete si zazálohovat soubory jauth.db a logs.db a můžete je smazat.
Pokud se něco pokazí a nemůžete problém vyřešit, vraťte přístup k databázi do lizmap/var/config/profiles.ini.php jako dříve, například takto :
[jdb:jauth]
driver=sqlite3
database="var:db/jauth.db"
[jdb:lizlog]
driver=sqlite3
database="var:db/logs.db"
A Lizmap by měl fungovat dobře, ale stále s Sqlite.