Upgrading (from version 1)
If you already have an existing Version 1 installation of classroombookings and want to update it to Version 2, the process should be straightforward but involves some manual intervention.
Check that your hosting envrionment or server meets the new requirements, and then proceed with the steps below.
- Make a backup of your database.
- Make a copy of the
index.phpfile in your current classroombookings install.
- Download and extract the latest Version 2 archive.
- Place the version 2 files in the same folder as the current version 1 installation, making sure to overwrite or replace the
index.phpfile. All other folders and files are new, and do not conflict with existing ones.
- Ensure the
uploadsdirectories have 'write' permissions. On Unix-based systems, this is usually 664 or 775.
- Using a web browser, visit the URL of the folder where you extracted the files. E.g. http://local-server/classroombookings/
- This will load the upgrade process which will guide you through the next steps.
The upgrade process carries out a number of tasks:
- Retrieves your current database settings, checks the connection, and looks for your current classroombookings installation.
- Copies any school logo or room photo files to a new location.
- Makes necessary changes to database tables.
- Upgrades the password storage security.
- Writes a new configuration file.
Backup your database
The upgrade process makes several changes to the database, so it is a good idea to make a backup copy should any of these fail. It is easy to do this using visual tools like Adminer, HeidiSQL and phpMyAdmin, but it is possible to do it via the mysqldump command line client.
This example demonstrates how to use the command to create a copy of the crbs_db database and save it to the crbs_db_backup.sql file, logging in as the crbs_user user.
$ mysqldump -u crbs_user -p crbs_db > crbs_db_backup.sql Enter password: ********
Download, extract and upload
If you have the ability to download and extract zip files on the server itself, it's quicker, safer and more efficient to do that.
This example shows how to do this on the command line using the tools wget and unzip. Replace the URL to the zip file with the latest version, from the Download page. Change directory into the web server document root or classroombookings folder first, as the zip file will be extracted into the current folder.
$ wget https://github.com/craigrodway/classroombookings/releases/download/v2.0.0/classroombookings-v2.0.0.zip $ unzip classroombookings-v2.0.0.zip -d . ... replace ./index.php? [y]es, [n]o, [A]ll, [N]one, [r]ename: y ...
If you don't have command line access to the server, download the zip file of the latest version from the website using a web browser and save it to your computer. Extract the archive to a temporary folder. You will then need to transfer all of these files to the server. How you do this will depend on what protocols your server supports, but this is commonly done via SCP, SFTP or FTP.
There are two folders that need 'write' permissions from the web server user. This is essential for core functionality (user sessions and log files) and uploaded files (user import CSV, school logo, room photos) to work properly.
On Unix-based systems, this is usually represented by 664 or 775 in numeric values; or 'drwxrwxr-x' in its string representation.
If these aren't already set, you should be able to do this on the command line like in this example:
$ chmod -R 775 local $ chmod -R 775 uploads
If you don't have command line access, most file transfer applications such as WinSCP or FileZilla allow these to be set via the interface.
Run the upgrade process
Using a browser, visit the IP address or URL on the server where the classroombookings files were extracted. You should see the following page.
The upgrade process will try to automatically detect the URL your classroombookings installation uses, and populates the URL field. Check that this is correct, and adjust it if necessary.
It will also find your existing database settings, test your connection and check your current install.
If any errors are present, the status will report an error and display some guidance notes.
If all checks are successful, click the Upgrade button.
When complete, the confirmation page will be displayed.
Check that your installation works as expected by logging in with your account details and confirm the various pages load OK.
If everything is fine, you can safely delete the following folders and files from version 1, as they are no longer required: