-
Notifications
You must be signed in to change notification settings - Fork 5
Migrating the database from DIBS version 0.4 to 0.5
DIBS version 0.5 brings significant changes and new features, but it is also not fully backward compatible with version 0.4. Apart from updating the settings.ini file (which has some format changes) and examining differences in the HTML page templates (if you made any changes in your local installation of DIBS), the most serious change is in the database object models used in the DIBS database.
We provide two scripts in 0.5 that we hope will help with migration. They are located in the admin subdirectory of the DIBS source tree.
-
export-datacan be used to produce CSV or JSON files out of the separate database tables in DIBS. It is particularly useful for migration: runexport-datawith its default settings and then use that in combination withimport-data. -
import-datacan be used to import an archive produced byexport-data, to (re)load a DIBS database.
Here is a rough sequence of actions that should help reload a database from version 0.4 into a version 0.5 installation of DIBS. This assumes you have already downloaded the version 0.5 distribution of DIBS somewhere on the same computer where you have installed version 0.4.
- If you already have data in your new version 0.5 DIBS database, make a backup copy of that database file (the one named
dibs.db, or whatever you configured it to be in your existingsettings.inifile). This is only a precaution if you have real data in your database; you can skip this if you are starting with a fresh installation of DIBS 0.5. - Find
export-datafrom the 0.5 distribution of DIBS (it's in theadminsubdirectory) and runto produce a file namedexport-data --base-name saved --database PATH-TO-YOUR-EXISTING-DIBS.DBsaved.zipin the current directory. ReplacePATH-TO-YOUR-EXISTING-DIBS.DBwith the path to your existing 0.4 DIBS database file, wherever it may be on the computer. (Note: you can use the newexport-dataprogram even with the 0.4 version of the DIBS database.) - Go to your DIBS 0.5 installation, and assuming the path to your 0.5 database is
PATH-TO-NEW-DIBS.DB, now runwhereimport-data --database PATH-TO-NEW-DIBS.DB PATH-TO-saved.zipPATH-TO-saved.zipis the path to thesaved.zipfile created in step #2.
This should add to the DIBS 0.5 database file all the item, person and history saved from the previous installation of DIBS. It will skip duplicate entries (i.e., items with duplicate barcodes, people with duplicate uname values).