1st version of the upgrade documentation

pull/762/head
Iglocska 2015-09-25 11:58:42 +02:00
parent 656a391223
commit af53475952
3 changed files with 92 additions and 71 deletions

View File

@ -1,4 +1,5 @@
# 1. Upgrade procedure from v2.2 to v2.3
# 1. Upgrade procedure from v2.3 to v2.4
# it is assumed that a the upgrade happens from an up-to-date 2.3 instance
# - git pull the latest version of MISP from https://github.com/MISP/MISP.git
@ -9,75 +10,12 @@ find /var/www/MISP/app/tmp/cache/ -type f -not -name 'empty' -delete
cd /var/www/MISP
git rm --cached app/Plugin/CakeResque/
# upgrade your database with the new tables / fields introduces in 2.4
cd /var/www/MISP/INSTALL
mysql -u [misp_mysql_user] -p [misp_database] < upgrade_2.4.sql
# Check if the permissions are set correctly using the following commands as root:
chown -R www-data:www-data /var/www/MISP
chmod -R 750 /var/www/MISP
chmod -R g+ws /var/www/MISP/app/tmp
chmod -R g+ws /var/www/MISP/app/files
chmod -R g+ws /var/www/MISP/app/files/scripts/tmp
# After this run the upgrade script from within the application
# simply navigate to Administration -> Administrative Tools -> Upgrade to 2.4
# 2. Get the new dependencies introduced in version 2.3
# install Mitre's STIX and its dependencies by running the following commands:
apt-get install python-dev python-pip libxml2-dev libxslt-dev zlib1g-dev
cd /var/www/MISP/app/files/scripts
git clone https://github.com/CybOXProject/python-cybox.git
git clone https://github.com/STIXProject/python-stix.git
cd /var/www/MISP/app/files/scripts/python-cybox
git checkout v2.1.0.10
python setup.py install
cd /var/www/MISP/app/files/scripts/python-stix
git checkout v1.1.1.4
python setup.py install
# install / update CakeResque (using the background workers is optional buy highly recommended)
cd /var/www/MISP/app
curl -s https://getcomposer.org/installer | php
php composer.phar require kamisama/cake-resque:4.1.2
php composer.phar config vendor-dir Vendor
php composer.phar install
# To use the scheduler worker for scheduled tasks, do the following:
cp -fa /var/www/MISP/INSTALL/setup/config.php /var/www/MISP/app/Plugin/CakeResque/Config/config.php
# 3. Update the database and settings to be compatible with MISP 2.3
# Update the database of MISP by running the following command
mysql -u <database login> -p<database password> <misp table name> < /var/www/MISP/INSTALL/upgrade_2.3.sql
# MISP has moved to a new configuration system. It might be a good idea to note down the old settings before removing them.
# Wherever applicable, you can remove .b from the default configuration file's name to get the non-background worker enabled version, however this is not recommended
mv /var/www/MISP/app/Config/bootstrap.b.default.php /var/www/MISP/app/Config/bootstrap.php
mv /var/www/MISP/app/Config/core.b.default.php /var/www/MISP/app/Config/core.php
mv /var/www/MISP/app/Config/config.default.php /var/www/MISP/app/Config/config.php
# Enable the background workers by uncommenting CakePlugin::loadall(array('CakeResque' => array('bootstrap' => true))); in /var/www/MISP/app/Config/bootstrap.php
# Make sure that the files in config are owned by the apache user
chown -R www-data:www-data /var/www/MISP/app/Config/*
# Log into MISP using your site admin credentials
# navigate to Administration -> Server settings
# Make sure that all of settings related tabs are filled out correctly.
# The tool will tell you about any potential issues and remedies, just follow the instructions
# Once done, have a look at the diagnostics
# If any of the directories that MISP uses to store files is not writeable to the apache user, change the permissions
# you can do this by running the following commands:
chmod -R 750 /var/www/MISP/<directory path with an indicated issue>
chown -R www-data:www-data /var/www/MISP/<directory path with an indicated issue>
# Make sure that the STIX libraries and GnuPG work as intended, if not, refer to INSTALL.txt's paragraphs dealing with these two items
# If you still have the background workers started from before the upgrade, the interface will not allow you to restart the workers
# This is because according to the install script in the previous version the background workers were advised to be started after boot in rc.local using the root user
# If this is the case for you, make sure that you stop the workers using the command line with the following command:
/var/www/MISP/app/Console/cake CakeResque.CakeResque stop --all
# Amend your rc.local using the following command to always start the background workers using the apache user (substitute www-data with your apache user)
su www-data -c 'bash /var/www/MISP/app/Console/worker/start.sh'
# Start the background workers using the application by navigating to the workers tab in the server settings and clicking on the "Restart all workers" button.
# Since this version is still not finished, expect to run into issues.
# Please report any such issues that you run into via github.

View File

@ -0,0 +1,83 @@
# 1. Upgrade procedure from v2.2 to v2.3
# - git pull the latest version of MISP from https://github.com/MISP/MISP.git
# delete everything from MISP's cache directory to get rid of the cached models
find /var/www/MISP/app/tmp/cache/ -type f -not -name 'empty' -delete
# clear the old submodule cached entry for CakeResque
cd /var/www/MISP
git rm --cached app/Plugin/CakeResque/
# Check if the permissions are set correctly using the following commands as root:
chown -R www-data:www-data /var/www/MISP
chmod -R 750 /var/www/MISP
chmod -R g+ws /var/www/MISP/app/tmp
chmod -R g+ws /var/www/MISP/app/files
chmod -R g+ws /var/www/MISP/app/files/scripts/tmp
# 2. Get the new dependencies introduced in version 2.3
# install Mitre's STIX and its dependencies by running the following commands:
apt-get install python-dev python-pip libxml2-dev libxslt-dev zlib1g-dev
cd /var/www/MISP/app/files/scripts
git clone https://github.com/CybOXProject/python-cybox.git
git clone https://github.com/STIXProject/python-stix.git
cd /var/www/MISP/app/files/scripts/python-cybox
git checkout v2.1.0.10
python setup.py install
cd /var/www/MISP/app/files/scripts/python-stix
git checkout v1.1.1.4
python setup.py install
# install / update CakeResque (using the background workers is optional buy highly recommended)
cd /var/www/MISP/app
curl -s https://getcomposer.org/installer | php
php composer.phar require kamisama/cake-resque:4.1.2
php composer.phar config vendor-dir Vendor
php composer.phar install
# To use the scheduler worker for scheduled tasks, do the following:
cp -fa /var/www/MISP/INSTALL/setup/config.php /var/www/MISP/app/Plugin/CakeResque/Config/config.php
# 3. Update the database and settings to be compatible with MISP 2.3
# Update the database of MISP by running the following command
mysql -u <database login> -p<database password> <misp table name> < /var/www/MISP/INSTALL/upgrade_2.3.sql
# MISP has moved to a new configuration system. It might be a good idea to note down the old settings before removing them.
# Wherever applicable, you can remove .b from the default configuration file's name to get the non-background worker enabled version, however this is not recommended
mv /var/www/MISP/app/Config/bootstrap.b.default.php /var/www/MISP/app/Config/bootstrap.php
mv /var/www/MISP/app/Config/core.b.default.php /var/www/MISP/app/Config/core.php
mv /var/www/MISP/app/Config/config.default.php /var/www/MISP/app/Config/config.php
# Enable the background workers by uncommenting CakePlugin::loadall(array('CakeResque' => array('bootstrap' => true))); in /var/www/MISP/app/Config/bootstrap.php
# Make sure that the files in config are owned by the apache user
chown -R www-data:www-data /var/www/MISP/app/Config/*
# Log into MISP using your site admin credentials
# navigate to Administration -> Server settings
# Make sure that all of settings related tabs are filled out correctly.
# The tool will tell you about any potential issues and remedies, just follow the instructions
# Once done, have a look at the diagnostics
# If any of the directories that MISP uses to store files is not writeable to the apache user, change the permissions
# you can do this by running the following commands:
chmod -R 750 /var/www/MISP/<directory path with an indicated issue>
chown -R www-data:www-data /var/www/MISP/<directory path with an indicated issue>
# Make sure that the STIX libraries and GnuPG work as intended, if not, refer to INSTALL.txt's paragraphs dealing with these two items
# If you still have the background workers started from before the upgrade, the interface will not allow you to restart the workers
# This is because according to the install script in the previous version the background workers were advised to be started after boot in rc.local using the root user
# If this is the case for you, make sure that you stop the workers using the command line with the following command:
/var/www/MISP/app/Console/cake CakeResque.CakeResque stop --all
# Amend your rc.local using the following command to always start the background workers using the apache user (substitute www-data with your apache user)
su www-data -c 'bash /var/www/MISP/app/Console/worker/start.sh'
# Start the background workers using the application by navigating to the workers tab in the server settings and clicking on the "Restart all workers" button.