Go to bin directory in Project Portal 2015 installation and run the script:
> cd ~/2015/Kronodoc/KRONO/bin
> ./migrateto40.sh
Note: If the Project Portal 3.4 has certain add-on components (e.g. AD), sql/scripts/34schemato40.sql will need some modifications.