Dashboard database migration: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
Here are the migration steps. | Here are the migration steps. Before starting, note that there are two users: | ||
*'''jenkins''' with a home directory /var/lib/jenkins and most of the Lingoport programs are in the /var/lib/jenkins/lingoport folder. | |||
*'''centos''' or '''ec2-user''' or another name - this is the user that has sudo permission on the system. | |||
1. | 1.As the jenkins user, stop Dashboard Server 9.4.1 | ||
./lingoport/dashboard-server-9.4.1/bin/linux-x86-64/sonar.sh stop | ./lingoport/dashboard-server-9.4.1/bin/linux-x86-64/sonar.sh stop | ||
2. | 2. As the sudo user, delete sonardb database | ||
sudo -u postgres psql | sudo -u postgres psql (''note: this may give a permission error, but continue anyway'') | ||
drop database lingodash; | drop database lingodash; | ||
create database lingodash; | create database lingodash; | ||
grant all privileges on database lingodash to lingodashuser; | grant all privileges on database lingodash to lingodashuser; | ||
quit | |||
3. | 3. Returning to the jenkins user, modify sonar.properties of Dashboard server 7.8.3 | ||
lingoport/dashboard-server-7.8.3/conf/sonar.properties | lingoport/dashboard-server-7.8.3/conf/sonar.properties | ||
* Make a copy of current mysql version sonar.properties file and name it sonar.propertiesmysql | * Make a copy of current mysql version sonar.properties file and name it sonar.propertiesmysql | ||
| Line 21: | Line 24: | ||
sonar.search.javaOpts=-Xmx1g -Xms1g -XX:+HeapDumpOnOutOfMemoryError | sonar.search.javaOpts=-Xmx1g -Xms1g -XX:+HeapDumpOnOutOfMemoryError | ||
* Also | * Also comment out duplicate sonar.jdbc.url and sonar.search.javaOpts lines in the file. | ||
4. Start Dashboard Server 7.8.3 | 4. Start Dashboard Server 7.8.3 | ||
| Line 28: | Line 31: | ||
./lingoport/dashboard-server-7.8.3/bin/linux-x86-64/sonar.sh start | ./lingoport/dashboard-server-7.8.3/bin/linux-x86-64/sonar.sh start | ||
* Go to the Dashboard url and there should be no | * Go to the Dashboard url and there should be no projects (the login has also reverted back to ‘admin/admin’) | ||
5. Stop Dashboard Server 7.8.3 | 5. Stop Dashboard Server 7.8.3 | ||
| Line 37: | Line 40: | ||
6. Run the command | 6. Run the command | ||
cd lingoport | |||
cp update/mysql-migrator-1.2-SNAPSHOT.zip . | |||
unzip mysql-migrator-1.2-SNAPSHOT.zip | |||
./mysql-migrator-1.2-SNAPSHOT/bin/mysql-migrator -source /var/lib/jenkins/lingoport/dashboard-server-7.8.3/conf/sonar.propertiesmysql -target /var/lib/jenkins/lingoport/dashboard-server-7.8.3/conf/sonar.properties | ./mysql-migrator-1.2-SNAPSHOT/bin/mysql-migrator -source /var/lib/jenkins/lingoport/dashboard-server-7.8.3/conf/sonar.propertiesmysql -target /var/lib/jenkins/lingoport/dashboard-server-7.8.3/conf/sonar.properties | ||
7. Start Dashboard Server 7.8.3 | 7. Start Dashboard Server 7.8.3 | ||
dashboard-server-7.8.3/bin/linux-x86-64/sonar.sh start | |||
* The password has returned to the original password. | * The password has returned to the original password. | ||
* Check the | * Check that the projects all exist then stop the server | ||
dashboard-server-7.8.3/bin/linux-x86-64/sonar.sh stop | |||
8. Install SonarQube 7.9 Community Edition | 8. Install SonarQube 7.9 Community Edition | ||
cp update/sonarqube-7.9.6.zip . | |||
cp | unzip sonarqube-7.9.6.zip | ||
cp dashboard-server-7.8.3/conf/sonar.properties sonarqube-7.9.6/conf/. | |||
sonarqube-7.9.6/bin/linux-x86-64/sonar.sh start | |||
* Browse to http://yourSonarQubeServerURL/setup and follow the setup instructions and click “Migrate database” button | * Browse to http://yourSonarQubeServerURL/setup and follow the setup instructions and click “Migrate database” button | ||
* Login to sonarqube and you can see all the project names but no other details | * Login to sonarqube and you can see all the project names but no other details | ||
* Stop SonarQube 7.9 | * Stop SonarQube 7.9 | ||
sonarqube-7.9.6/bin/linux-x86-64/sonar.sh stop | |||
9. Install SonarQube 8.9 Community Edition | 9. Install SonarQube 8.9 Community Edition | ||
cp update/sonarqube-8.9.8.54436.zip . | |||
cp | unzip sonarqube-8.9.8.54436.zip | ||
cp dashboard-server-7.8.3/conf/sonar.properties sonarqube-8.9.8.54436/conf/ | |||
sonarqube-8.9.8.54436/bin/linux-x86-64/sonar.sh start | |||
* Browse to http://yourSonarQubeServerURL/setup and follow the setup instructions and click “Migrate database” button | * Browse to http://yourSonarQubeServerURL/setup and follow the setup instructions and click “Migrate database” button | ||
* Login to sonarqube and you can see all the project names but no other details | * Login to sonarqube and you can see all the project names but no other details | ||
* Stop SonarQube 8.9 | * Stop SonarQube 8.9 | ||
sonarqube-8.9.8.54436/bin/linux-x86-64/sonar.sh stop | |||
10. Start Dashboard Server 9.4.1 | 10. Start Dashboard Server 9.4.1 | ||
cp | cp dashboard-server-7.8.3/conf/sonar.properties dashboard-server-9.4.1/conf | ||
rm -rf | rm -rf dashboard-server-9.4.1/data/es7 | ||
* Start SonarQube 9.4.1 | * Start SonarQube 9.4.1 | ||
dashboard-server-9.4.1/bin/linux-x86-64/sonar.sh start | |||
* Browse to http://yourSonarQubeServerURL/setup and follow the setup instructions and click “Migrate database” button | * Browse to http://yourSonarQubeServerURL/setup and follow the setup instructions and click “Migrate database” button | ||
| Line 83: | Line 90: | ||
* If there are no projects showing, stop the server and delete dashboard-server-9.4.1/data/es7 folder | * If there are no projects showing, stop the server and delete dashboard-server-9.4.1/data/es7 folder | ||
** Start SonarQube 9.4.1 | ** Start SonarQube 9.4.1 | ||
dashboard-server-9.4.1/bin/linux-x86-64/sonar.sh start | |||
** Delete the es7 folder | ** Delete the es7 folder | ||
rm -rf ./lingoport/dashboard-server-9.4.1/data/es7 | rm -rf ./lingoport/dashboard-server-9.4.1/data/es7 | ||
Revision as of 20:51, 10 June 2022
Here are the migration steps. Before starting, note that there are two users:
- jenkins with a home directory /var/lib/jenkins and most of the Lingoport programs are in the /var/lib/jenkins/lingoport folder.
- centos or ec2-user or another name - this is the user that has sudo permission on the system.
1.As the jenkins user, stop Dashboard Server 9.4.1
./lingoport/dashboard-server-9.4.1/bin/linux-x86-64/sonar.sh stop
2. As the sudo user, delete sonardb database
sudo -u postgres psql (note: this may give a permission error, but continue anyway) drop database lingodash; create database lingodash; grant all privileges on database lingodash to lingodashuser; quit
3. Returning to the jenkins user, modify sonar.properties of Dashboard server 7.8.3
lingoport/dashboard-server-7.8.3/conf/sonar.properties
- Make a copy of current mysql version sonar.properties file and name it sonar.propertiesmysql
- Then modify the sonar.properties file as
sonar.jdbc.username=lingodashuser
sonar.jdbc.password=password can be found on dashboard-server-9.4.1/conf/sonar.properties
sonar.jdbc.url=jdbc:postgresql://localhost/lingodash
sonar.search.javaOpts=-Xmx1g -Xms1g -XX:+HeapDumpOnOutOfMemoryError
- Also comment out duplicate sonar.jdbc.url and sonar.search.javaOpts lines in the file.
4. Start Dashboard Server 7.8.3
cd ./lingoport/dashboard-server-7.8.3/bin/linux-x86-64/sonar.sh start
- Go to the Dashboard url and there should be no projects (the login has also reverted back to ‘admin/admin’)
5. Stop Dashboard Server 7.8.3
./lingoport/dashboard-server-7.8.3/bin/linux-x86-64/sonar.sh stop rm ./lingoport/dashboard-server-7.8.3/data/es6
6. Run the command
cd lingoport cp update/mysql-migrator-1.2-SNAPSHOT.zip . unzip mysql-migrator-1.2-SNAPSHOT.zip ./mysql-migrator-1.2-SNAPSHOT/bin/mysql-migrator -source /var/lib/jenkins/lingoport/dashboard-server-7.8.3/conf/sonar.propertiesmysql -target /var/lib/jenkins/lingoport/dashboard-server-7.8.3/conf/sonar.properties
7. Start Dashboard Server 7.8.3
dashboard-server-7.8.3/bin/linux-x86-64/sonar.sh start
- The password has returned to the original password.
- Check that the projects all exist then stop the server
dashboard-server-7.8.3/bin/linux-x86-64/sonar.sh stop
8. Install SonarQube 7.9 Community Edition
cp update/sonarqube-7.9.6.zip . unzip sonarqube-7.9.6.zip cp dashboard-server-7.8.3/conf/sonar.properties sonarqube-7.9.6/conf/. sonarqube-7.9.6/bin/linux-x86-64/sonar.sh start
- Browse to http://yourSonarQubeServerURL/setup and follow the setup instructions and click “Migrate database” button
- Login to sonarqube and you can see all the project names but no other details
- Stop SonarQube 7.9
sonarqube-7.9.6/bin/linux-x86-64/sonar.sh stop
9. Install SonarQube 8.9 Community Edition
cp update/sonarqube-8.9.8.54436.zip . unzip sonarqube-8.9.8.54436.zip cp dashboard-server-7.8.3/conf/sonar.properties sonarqube-8.9.8.54436/conf/ sonarqube-8.9.8.54436/bin/linux-x86-64/sonar.sh start
- Browse to http://yourSonarQubeServerURL/setup and follow the setup instructions and click “Migrate database” button
- Login to sonarqube and you can see all the project names but no other details
- Stop SonarQube 8.9
sonarqube-8.9.8.54436/bin/linux-x86-64/sonar.sh stop
10. Start Dashboard Server 9.4.1
cp dashboard-server-7.8.3/conf/sonar.properties dashboard-server-9.4.1/conf rm -rf dashboard-server-9.4.1/data/es7
- Start SonarQube 9.4.1
dashboard-server-9.4.1/bin/linux-x86-64/sonar.sh start
- Browse to http://yourSonarQubeServerURL/setup and follow the setup instructions and click “Migrate database” button
- If there are no projects showing, stop the server and delete dashboard-server-9.4.1/data/es7 folder
- Start SonarQube 9.4.1
dashboard-server-9.4.1/bin/linux-x86-64/sonar.sh start
- Delete the es7 folder
rm -rf ./lingoport/dashboard-server-9.4.1/data/es7