-
Notifications
You must be signed in to change notification settings - Fork 138
How to upgrade
If you are upgrading Munkireport from a previous version, there are some things to keep in mind.
Although we try to make upgrading as smooth as possible, there may be cases where the upgrade (or the one who makes the upgrade) does bad things to your database. Use a backup strategy that fits the database backend you are using.
SQLite
The standard location of the SQLite database is in the app/db directory, if you're upgrading by downloading the new version of Munkireport and copying the files over the previous version, this database is going to be lost. To backup your SQLite database safely, navigate to the directory in which your database is located and run:
sqlite3 db.sqlite '.backup db.backup.sqlite'
Now move db.backup.sqlite out of the way for safe keeping.
MySQL
You can backup a MySQL database using different methods:
- via the command line using mysqldump
- with phpMyAdmin if you have that installed
- with a fat client like Sequel Pro
If your database does get deleted, you can also just wait until your clients fill it up again
Make a copy of config.php
and store it in a safe place.
The easiest and safest way to upgrade is using git
. When you use git, the SQLite database does not get overwritten and your config.php file stays intact. With git it is easy to revert the update if things don't work out so well. The following assumes that you set up munkireport with git (git clone https://github.com/munkireport/munkireport-php.git
)
To checkout the latest master:
git checkout master
git pull
If you can't use git, then you can copy the new files to the proper location. If you're running Munkireport from a subdirectory called 'munkireport', you can rename that directory to 'munkireport.old'. Then you put the new version up under 'munkireport' and copy config.php and optionally db.sqlite to 'munkireport'.
The admin must manually trigger a database migration. That can be done two ways.
- Run the migration script from the munkireport-php folder on the server via CLI
php database/migrate.php
- In the web console access the
Admin->Database
menu and click theUpdate
button.
After a successful upgrade, you might find that pages don't load properly. This is common, and is usually related to your browser caching the GUI elements from the old version.
To confirm this is the case, try loading your site from another web browser. If that loads fine, clear your primary browser's cache and HTML5 local storage.
For Safari:
- Hold Command and Option, then press C.
- Enter the following code into the window that pops up:
localStorage.clear()
- Press Enter to submit.
- In the Safari menu, select Clear History.
- General Upgrade Procedures
- How to Upgrade Versions
- Troubleshooting Upgrades
- Migrating sqlite to MySQL