Difference between revisions of "Dashboard database migration"

From Lingoport Wiki
Jump to: navigation, search
 
(6 intermediate revisions by 2 users not shown)
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.
  +
* Several times in this migration, the Dashboard will be started. This may take several minutes for the URL to come up and may give errors while initializing. To troubleshoot, verify that the Dashboard is running from the command line using the status option:
  +
/var/lib/jenkins/lingoport/<path to Dashboard server>/bin/linux-x86-64/sonar.sh status
   
1.Stop Dashboard Server 9.4.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. Delete sonardb database
+
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. Modify sonar.properties of Dashboard server 7.8.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
+
cp lingoport/dashboard-server-7.8.3/conf/sonar.properties lingoport/dashboard-server-7.8.3/conf/sonar.propertiesmysql
Make a copy of current mysql version sonar.properties file and name it sonar.propertiesmysql
+
vi lingoport/dashboard-server-7.8.3/conf/sonar.properties
  +
* Then modify the sonar.properties file as
   
  +
sonar.jdbc.username=lingodashuser
Then modify the sonar.properties file as
 
  +
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 any duplicate sonar.jdbc.url and sonar.search.javaOpts lines in the file.
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 commented 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 29: Line 33:
 
./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 project (the login has also reverted back to ‘admin/admin’)
+
* 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
   
 
./lingoport/dashboard-server-7.8.3/bin/linux-x86-64/sonar.sh stop
 
./lingoport/dashboard-server-7.8.3/bin/linux-x86-64/sonar.sh stop
rm ./lingoport/dashboard-server-7.8.3/data/es6
+
rm -rf ./lingoport/dashboard-server-7.8.3/data/es6
   
   
 
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
   
./lingoport/dashboard-server-7.8.3/bin/linux-x86-64/sonar.sh start
+
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 project all exists then stop the server
+
* Check that the projects all exist then stop the server
   
./lingoport/dashboard-server-7.8.3/bin/linux-x86-64/sonar.sh stop
+
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 ./lingoport/dashboard-server-7.8.3/conf/sonar.properties ./lingoport/sonarqube-7.9.6/conf/.
+
unzip sonarqube-7.9.6.zip
./lingoport/sonarqube-7.9.6/bin/linux-x86-64/sonar.sh start
+
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
./lingoport/sonarqube-7.9.6/bin/linux-x86-64/sonar.sh stop
+
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 lingoport/dashboard-server-7.8.3/conf/sonar.properties ./lingoport/sonarqube-8.9.8.54436/conf/.
+
unzip sonarqube-8.9.8.54436.zip
./lingoport/sonarqube-8.9.8.54436/bin/linux-x86-64/sonar.sh start
+
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
./lingoport/sonarqube-8.9.8.54436/bin/linux-x86-64/sonar.sh stop
+
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 lingoport/dashboard-server-7.8.3/conf/sonar.properties ./lingoport/dashboard-server-9.4.1/conf
+
cp dashboard-server-7.8.3/conf/sonar.properties dashboard-server-9.4.1/conf
rm -rf ./lingoport/dashboard-server-9.4.1/data/es7
+
rm -rf dashboard-server-9.4.1/data/es7
   
 
* Start SonarQube 9.4.1
 
* Start SonarQube 9.4.1
 
 
./lingoport/dashboard-server-9.4.1/bin/linux-x86-64/sonar.sh start
+
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
  +
* The projects should all be listed under the Projects tab and look correct.
   
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
 
  +
dashboard-server-9.4.1/bin/linux-x86-64/sonar.sh start
* Start SonarQube 9.4.1
 
  +
** Delete the es7 folder
./lingoport/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
 
rm -rf ./lingoport/dashboard-server-9.4.1/data/es7

Latest revision as of 19:38, 15 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.
  • Several times in this migration, the Dashboard will be started. This may take several minutes for the URL to come up and may give errors while initializing. To troubleshoot, verify that the Dashboard is running from the command line using the status option:
    /var/lib/jenkins/lingoport/<path to Dashboard server>/bin/linux-x86-64/sonar.sh status

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

   cp lingoport/dashboard-server-7.8.3/conf/sonar.properties lingoport/dashboard-server-7.8.3/conf/sonar.propertiesmysql
   vi lingoport/dashboard-server-7.8.3/conf/sonar.properties
  • 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 any 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 -rf ./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
  • The projects should all be listed under the Projects tab and look correct.
  • 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