The Collec-Science software needs a Apache server, a Postgresql database, and for some functions (password recovery in particular), an email relay activated.
Here are the different operations you will need to do to install the software:
- install a dedicated server (preferably, but it is not required);
- configure Apache, PHP;
- download the software;
- create the PostgreSQL database;
- set up the software.
Installation in mono mode
If you want to install the application in a dedicated server, which will include both the database and the code of the application, you can use a script that will almost automatically perform all the necessary operations.
First, install a Linux server (tested with Debian 9, should work with Ubuntu 16 or 18) then, in the console, enter the following commands :
wget https://github.com/Irstea/collec/raw/master/install/deploy_new_instance.sh sudo -s ./deploy_new_instance.sh
The script will install all the necessary packages, download the software and prepare the configuration.
You want to move the database to a dedicated server, the application is hosted (or not) in a shared web server. You can enter this kind of script:
By adapting the configuration to your situation. To set up database connections and the different strategies to apply, consult the complete documentation:
Warning: the version 2.4.0 requires PHP 7.2 or above. To upgrade Ubuntu or Debian system, run this script:
Several ways s are possible, depending on whether your installation was done with the automatic deployment script (see above) or not.
Precautions of use
- check that you have a recent backup stored in another media in your database
- the param / param.inc.php file, which contains your local settings, must also have been saved
- after installing and verifying that everything is working, remove the install folder from the new version.
Collec-Science is installed in a dedicated server, which includes both the application and the database
the database connection account has not been changed from the default configuration
the application is stored in the /var/www/html/collec-science/xxxx folder, the /var/www/html/collec-science/collec link points to xxxx, and the virtual site (in /etc/apache /sites-available) includes this line: DocumentRoot /var/www/html/collec-science/collec
Depending on your version, identify the file that corresponds to the update to be applied (the first set of numbers corresponds to your current version):
Connect to your server, then:
Download and run the update script you selected:
wget https://github.com/Irstea/collec/raw/master/install/script_name chmod +x script_name ./script_name
The script will download the release and perform the installation.
You do not answer exactly case 1, and you are already in version 1.2:
Connect to your server, then:
Step 1 : download the release
Go to the program installation folder:
Download the application code:
wget https://github.com/Irstea/collec/archive/master.zip unzip master.zip mv collec-master collec-2.4.0
Step 2: Update the database
If you use schemas that are not “col” and “gacl”, also edit the files to put the right values:
pgsql/col_alter_1.2-1.2-188.8.131.52.sql pgsql/col_alter_184.108.40.206-2.0.sql pgsql/col_alter_2.0-2.1.1.sql pgsql/col_alter_2.1-2.2.2.sql pgsql/col_alter_2.2-2.3.3.sql pgsql/gacl_alter_2.2-2.3.sql pgsql/col_alter_2.3-2.4.sql
Step 2.1: If the database is hosted on the same server:
Depending on the level of your current version, edit the files:
upgrade-1.2-1.2-220.127.116.11.sql upgrade-18.104.22.168-2.0.0.sql upgrade-2.0-2.1.1.sql upgrade-2.1-2.1-2.2.sql upgrade-2.2-2.3.sql upgrade-2.3-2.4.sql
and check/adapt the connection settings to the database.
Run the “upgrade” scripts with the command :
su postgres -c "psql -f upgrade-xx-yy.sql"
in order to upgrade your database to the current version
Step 2.2: If the database is hosted on another server:
run each update script, depending on your version, with the command :
psql -h server -U username -W -d database -c "col_alter_xx-yy.sql"
Step 3: Switch to the new version
Copy the previous version of param/param.inc.php and the encryption keys for the identification tokens:
cd ../.. cp old_folder/param/param/param.inc.php collec-2.4.0/param/ cp old_folder/param/id_collec* collec-2.4.0/param/
delete the symbolic link (if this is the mechanism you used), and recreate it:
rm collec ln -s collec-2.4.0 collec
Your instance is in a version prior to version 1.2.
This is an adaptation of case 2, you will need to upgrade your database to version 1.2.
Perform step 1 of case 3: the application code is now downloaded
In the folder collec-2.3/install/pgsql, you will find all the scripts corresponding to the different updates required.
edit each file to be executed, and check the names of the schemas
run each script until you reach version 1.2, with the following command:
psql -h server -U username -W -d database -c "col_alter_1.1-1.2.2.sql"
to update from version 1.1 to version 1.2
Then carry out steps 2 and 3 of case n°2.
An installation of the application via Docker is available, specifically designed for Rasperry (application running in embedded mode).
More information in https://github.com/jancelin/docker-collec
Pdf documentation (in french)
Please find it in GITHUB.