Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

Steps:

* Move files to location
* Import MySQL
* Configure OpenProject
* Move to Postgre
* Reconfigure OpenProject


cat << 'EOL' >openproject_config_migration.sh
#!/bin/bash
tar -xvf etcopenproject.tgz
cp etc/openproject/* /etc/openproject/ -R
chown openproject:openproject /etc/openproject/ -R
nano /etc/openproject/installer.dat && nano /etc/openproject/conf.d/database

EOL
chmod +x openproject_config_migration.sh
./openproject_config_migration.sh
cat << 'EOL' >openproject.sh
pause(){
 read -n1 -rsp $'Press any key to continue or Ctrl+C to exit...\n'
}
#!/bin/bash

mysqlopuserpwd=
psqlopuserpwd=
dbserver=localhost

echo "Moving Attachments"
pause
tar -xvf attachments-*.tar.gz
mkdir /var/db/openproject/files/
cp attachment /var/db/openproject/files/ -R
chown openproject:openproject /var/db/openproject/files/ -R

echo "Import DB to MySQL Next"
pause
zcat mysql-dump-*.sql.gz | mysql -u openproject -h $dbserver -p$mysqlopuserpwd openproject

#openproject configure

echo "Postgre SQL Migration Next"
pause
openproject config:set MYSQL_DATABASE_URL="$(openproject config:get DATABASE_URL)"
openproject config:get MYSQL_DATABASE_URL
openproject config:set DATABASE_URL="postgresql://openproject:$psqlopuserpwd@$dbserver/openproject" 
openproject config:get DATABASE_URL
sudo openproject run /opt/openproject/docker/mysql-to-postgres/bin/migrate-mysql-to-postgres

echo "OpenProject Reconfigure Next"
pause
openproject reconfigure
nano /etc/openproject/installer.dat && nano /etc/openproject/conf.d/database

echo "Remove MySQL Server Next"
pause
apt-get remove -y mysql-server
openproject config:unset MYSQL_DATABASE_URL

echo "Enable OpenService and Reboot?"
pause
systemctl enable openproject
reboot
EOL
chmod +x openproject.sh
./openproject.sh
  • No labels