Upgrading existing DB-files to 5.0.0
Not logged in

Back to 5.0.0-doc main page



Extended DB layout

The basic DB layout is unchanged, and still is exactly the same introduced by version 4.0
However several further meta-tables are now required by version 5.0 in order to fully support librasterlite2 integration, and their absence will forbid many interesting new features to correctly operate.

Any new DB-file created by version 5.0 will always contain all required tables.
  • If you are using the CLI or the GUI tool this will be automatically done
  • If instead you are initializing the DB-file by yourself there is a relevant change to be noted
  • SELECT InitSpatialMetaDataFull(...);
    
    This new SQL function will take care of fully initializing the DB-file creating all tables required by version 5.0
    The supported arguments are exactly the same of InitSpatialMetaData() with identical meaning.

    Caveat: InitSpatialMetaData() still continues to be supported, but it will simply create a 4.0 DB layout ignoring all the recent extensions introduced by 5.0.

Upgrading existing DB-files created by previous versions

The new meta-tables introduced by version 5.0 will obviously miss in any DB-file created by a previous version of SpatiaLite.
Upgrading old DB-files to the new 5.0 layout is extraordinarily simple:
SELECT CreateMissingSystemTables(...);
This SQL function will automatically identify any missing table, and will attempt to create it.
Calling CreateMissingSystemTables() is a safe and harmless operation, and will never affect any existing table.

Warning: CreateMissingSystemTables() will correctly work only on behalf of DB-files already supporting the 4.0 layout


If you absolutely need to upgrade some really obsolete DB-file you should use spatialite_convert, distributed within the CLI tools.
This tool was initially introduced by version 4.0, and has now been upgraded so to support also the new 5.0 DB layout.



Back to 5.0.0-doc main page