Database Updater module for Allmice CMS

Title: Database Updater module
Description: This module helps to update database structure changes of other modules.
Current version download link: click here to download Allmice CMS Database Updater module

Instructions for Database Updater module

Updating Allmice CMS editions and modules to new versions can mean two different sorts of updates:
1. Updating code of editions or code of modules.
System Manager module helps to update to new module versions.
Replacing all the files and directories except directories sites and custom and file .htaccess is part of updating the whole edition code.
2. Updating database structure or database default entries (which this module is about).

If you have used Allmice CMS for some time for a website, then you have probably added to this website during time a lot of content and made many configuration changes. If you wish then to use a new version of edition or new versions of modules for this old website, then such new versions may require some of the database structure and default entries to be changed. This module helps to perform automatically some most popular database changes so that web site would function as good as possible after such automatic updates. It also helps to recognize various less popular database changes, which should be done manually or in other way.

This module performs three main functionalities (check out the corresponding methods for these functionalities):
1. Update tables' structure.
2. Update missing entries.
3. Update different entries.


Before using this module

By using this module you must have installed at least two Allmice CMS websites:
1. Old website - this is the website, which database structure you wish to update.
2. Temporary new website - this is the current version of Allmice CMS, which database structure you wish to use as result of update for the old website.
Usually just minimal install is needed for the new website to have a database with new structure. In some cases it may be suggested to install to the new database also new versions of the same modules, which are in the old database.

The Database Updater module itself, which will be used for updating, can be installed on the new website or on a third website.

Following conditions must be followed for all the databases (databases of new website, old website and the website, where current module is used):
host, database user name and database password must be the same for all these two or three databases related to these websites.

Use corresponding websites' config files in sites directory in the Allmice CMS code directory/directories, where these two or three websites are located, to check out, that host, database user name and database password are the same. Use these config files also to find input data for the methods of this module - database name and prefix of database tables for the old and new websites.


1. Update tables' structure

In this event the properties "type" and "default value" of table fields can be changed automatically (if needed - if such difference exists in new versions compared with old version). Tables, which structure will be different because of other reasons between the new versions, will be recognized (manual or other sort of change will be needed for such differences).

New table field names (missing in old system version) and old table field names (missing in new system version) will be recognized. Such missing table fields need manual (or other sort of) change and can usually have three different reasons: some table fields were renamed, new table fields are used in a new version, some table fields in an old version have become obsolete.

For the tables' structure differences, which can be recognized using this module, but not solved automatically using this module, it is suggested:
to compare the tables using phpMyAdmin and find the reasons in such a way and to do changes manually according to the reasons.


2. Update missing entries

New default entries for tables core_config, core_language and core_misc_data will be added to the old database using this method.

It is suggested to do tables' structure update before doing missing entries update.
If tables' structure update shows that there are missing tables in old or new database, then it is suggested to solve this difference first before doing database missing entries update.

The reasons for such missing tables may be among other things as follows:
1. There have not been installed all the same modules for both databases.
If new database is minimal installation, then no need to do anything, if there are more tables in old database, because there have been additional modules installed to the old database.
2. Table name has changed in the new version.
3. Some table in the old version is not needed any more in the new version (has become obsolete in old database).


3. Update different entries

It is suggested to do missing entries update first, before doing different entries update.
Differences in tables core_config, core_language and core_misc_data can be updated in the old database using this method.
Not all differences are needing update. There is enough information provided for every difference for you to decide, whether to tick it for updating or not.

Differences, which usually need update:
* If in core_config table description is different for some configuration entry, then such difference usually needs update.
* Consider also updating default value differences in core_config table, if you don't need to keep in old database corresponding older configuration.
* If you have not changed language phrases, then probably you could update all different language phrases, but pay attention to language phrase siteName - no need to update this.

Differences, which usually do not need update:
* If configuration value is different, then it usually does not need update, but consider every such difference according to your needs. In core_config table there are configurations, which you may wish to keep as you have configured them before in old database.
* If you have changed language phrases, then pay attention to such language phrases - you probably wish to keep them in old database as you changed them - thus do not update them in this case.