Migrating to ZIM:X
The migration of Zim 9.x database to ZIM:X requires the steps below. For the purpose of this document, the expression “Old Database” means your existing Zim 9.x database whereas “New Database” means the migrated ZIM:X database.
A) Name Clarification
The following module and tool names are used in this migration:
. ZXSERVER and ZXCLIENT: Modules provided by the Zim:X product to run Zim:X databases;
. ZOMENABLE, ZOMDATASAVE, ZOMDATALOAD, ZOMEXPORT and ZOMIMPORT: Tools belonging to the ZOM package used to facilitate the migration;
. ZimServer and ZimQTC: Modules provided by previous versions of Zim.
B) Backup your Old Database
The migration process is destructive thus requiring you to backup your old database. For safety reasons, you can make more than one backup. Before the backup, make sure that no users are accessing the database and that ZimServer is no longer running. You must have killed ZimServer with the option “-k” to guarantee data integrity.
C) Export Data and Database Definitions From the Old Database
Using existing Zim tools, this step will export all database definitions and all data from the old database.
- Start ZimServer;
- Start a ZimQTC session to get the Zim prompt;
- From the prompt, run “ZOMENABLE” to access the ZOM tools;
- From the prompt, run “ZOMEXPORT *” to export all database definitions;
- From the prompt, run “ZOMDATASAVE *” to export all existing data;
- Kill ZimServer using the option “-k”.
The process above produces new files that could be backed up as well. If desired, this step can be executed before the backup.
D) Clean the Old Database
Certain files need to be deleted (removed) from the old database to make room for the new one:
- Remove all files with the name “ZIMxxxx” where “xxxx” ranges from “0000” to “9999”;
- Remove the operating system directories identified by “ZIMxxxx.WS”;
- Remove the operating system directories identified by “yyyyy” where “yyyyy” ranges from “00001” to “99999”;
- Remove the operating system directories named “DCRT” and “DPSRT”.
E) Install ZIM:X
Using the ZIM:X Full Installer, perform its installation on your computer following the installer guidelines.
F) Initialize the New Database
Still located in the old Zim database directory, initialize (create) the new database. From this point on, this database is going to be referred to as the “New Database”.
ZXCREATOR . ZIMXDATABASE
ZXCREATOR <full new database path> ZIMXDATABASE
G) Import the New Database Definitions
This step will import all database definitions to the new database. Should errors arise during the import, carefully inspect these errors and decide:
- The errors need to be corrected immediately: In this case, you will have to restore the database backup, correct the errors and then repeat steps A, B, C and E;
- If the errors are minor or could be ignored for the moment, proceed to the next step.
To import the database definitions:
- Start ZXSERVER;
- Start ZXCLIENT on the new database;
- Run “ZOMENABLE”;
- Run “ZOMIMPORT” to import all database definitions;
- Check for errors.
H) Import all Database Data
Run the following steps after importing the database definitions:
- Copy (save) the operating system directory “ZOMSAVING” to “ZOMSAVING.SAVE”. This copy is important; otherwise, the database data will be not be imported;
- Run “ZOMDATASAVE *” to create the structure to load the data. It will process zero records;
- Remove the operating system directory “ZOMSAVING”;
- Copy back the saved directory “ZOMSAVING.SAVE” to “ZOMSAVING”;
- Run “ZOMDATALOAD *” to import the database data.
I) Final Checks
The migration process to ZIM:X is now completed. You may still perform the following tasks:
- Kill (stop) ZXSERVER;
- Make a backup of your new database;
- Start ZXSERVER again along with ZXCLIENT;
- Compile your ZIM programs if applicable;
- Check your data and your database definitions;
- Run your application.