Skip to content
Barry O'Donovan edited this page May 16, 2020 · 3 revisions

NB: This applies to version 3.0.0 and greater only.

The upgrade process for ViMbAdmin is currently a manual task. Especially database schema updates.

The general process is:

1. Identify which version of ViMbAdmin you are running (it's in the footer of all web pages and it can be found in library/ViMbAdmin/Version.php.

2. Using Git, checkout the next version up from yours. All versions are tagged x.y.z.

# move to the directory where you have installed ViMbAdmin
cd /path/to/vimbadmin
# fetch any new objects (does not affect any files!)
git fetch 
# now, you can switch to the next version - let's assume our current version 
# is 3.0.2 and the next version is 3.0.3
git checkout 3.0.3

3. Ensure your external libraries are in sync via:

composer install --prefer-dist --no-dev 

4. Complete any tasks identified by the release announcement for your new version such as:

  • application.ini changes;
  • database schema updates;
  • review any changed view files against those that you may have skinned;
  • running additional scripts or tasks specified.

5. Restart Memcached. Do not forget / skip this step!

6. Repeat steps (2) - (5) until you've reached the latest version.

Correcting Database Issues / Verifying Your Schema

Because of the manual process of database updates, it is possible your database schema may fall out of sync.

If you are having issues, first and foremost, restart Memcached. Doctrine2 caches entities and schema information in Memcached so, after an upgrade, you must restart Memcached.

You can verify and update your schema using the bin/doctrine2-cli.php script. The first action should be validation - here is a working example with no database issues:

$ ./doctrine2-cli.php orm:validate-schema
[Mapping]  OK - The mapping files are correct.
[Database] OK - The database schema is in sync with the mapping files.

If there are issues, you can use the following to show what SQL commands are required to bring your schema into line:

$ ./doctrine2-cli.php orm:schema-tool:update --dump-sql

And you can let Doctrine make the changes for you via:

$ ./doctrine2-cli.php orm:schema-tool:update --force

Updating Entities, Proxies and Repositories

Doctrine2 maintains the entities, proxies and repository classes. Ideally you should never need to do the following on a production installation - as we maintain these files with Git - but if you're developing / testing ViMbAdmin, you may need to.

The process for updating these files with schema changes / updates is:

/etc/init.d/memcached restart    # (or as appropriate for your system)
./doctrine2-cli.php orm:generate-entities ../application/
./doctrine2-cli.php orm:generate-proxies
./doctrine2-cli.php orm:generate-repositories ../application/