sonarqube 4 server migration - postgresql

I'm trying to move a sonarqube 4.4 installation from one machine to another. What's more we would also like to change the database server from Oracle to Postgres 9.3.
What my plan was initially is that I would shutdown the sonar server, the database adminstrator would dump existing database, migrate it to postgres in the new server and I would zip the existing server installation and move it along to the new server. Then I would start the server.
However I've run into problems, even though sonarqube 4.4 booted fine, when I hit
http://new-server:9001/sonar4
I was getting a 404 response from sonar.
At some point I tried unzipping the server file anew in which case I managed to see the projects and the dashboards but no analysis data existed, even though last analysis time was available.
Any ideas or clues what am I missing?
Also, the driver in sonarqube for postgres is 9.1.xxx can I update this or should we use postgres 9.1 to make sure the driver is compatible with the database?

How is your ..\conf\sonar.properties? Normally, you should have changed:
sonar.jdbc.url=jdbc:oracle:thin:#localhost/XE
Did you use some tool to migrate Oracle to Postgress? I thought it was not possible.
Do not hesitate to ask for further precision.
Regards.

Related

Can't connect to databases in DBeaver

I'm having problems trying to connect to databases with DBeaver. I've managed to connect to one database fine with no problems. However, any additional connections is causing issues.
I keep getting the error
SCRAM authentication is not supported by this driver. You need JDK >= 8 and pgjdbc >= 42.2.0 (not ".jre" versions)
I've tried the exact same details in pgadmin, and can get into the database just fine.
I just much prefer DBeaver as pgadmin seems to lack some really basic features like autocompletion.
I've reinstalled postgres and dbeaver multiple times, ensuring that its the latest version of each, still nothing.
Fixed the issue. It appears that DBeaver was holding on to an outdated library, which was being checked first, and therefore failing the test.
Steps to solve issue.
Download latest JDBC and move to \Program Files\DBeaver\shared_drivers
Open DBeaver and click Database -> Driver Manager
Double click on PostgreSQL
Under libraries click Add file and find the new JDBC
Delete any of the previous libraries, so it remains the only one

AWS RDS PostgreSQL Upgrade from 9.6.22 to 10.17

Good day. I just finished upgrading my AWS RDS database engine from 9.6.22 to 10.17. I used these steps to make the upgrade using the AWS Console:
Create snapshot of target database to upgrade
Restore snapshot
Upgrade the restored snapshot's (which is now a new instance) DB Engine version.
After I did all of this, everything seems fine but when I access the database, this warning message appears
WARNING: psql major version 9.6, server major version 10.
Some psql features might not work.
I did not continue on my testing because I want to know what is the meaning of this first. Because I am fairly new in AWS as a whole. Thanks!
The meaning is that just because you are connecting to an upgraded database on some machine run by Amazon, the PostgreSQL installation on your local machine was not magically updated. psql from version 9.6 doesn't know what metadata tables were changed in v10, what features were removed and so on.
It would be a good idea to install a more recent version of PostgreSQL on your machine. By the way, upgrading to v10 was not the smartest move, as that version will go out of support in less than a year. You should upgrade to the latest version that your service provider offers.
The client program psql you are using to connect to the database is from an older version than the database it is connecting to. Some of the introspection features might not work. For example, psql from 9.6 won't know how to do tab completion for commands that were added to the server after 9.6.
This is generally not a major problem for psql (unless the server wants to use SCRAM authentication), but for optimal experience it would be good to install a newer client. Other tools like pg_dimp might not with at all against a server newer than they are.

How can I tell SQLDeveloper which version of JDBC to use?

I need to connect to an Oracle 9i server from my machine using SQLDeveloper. I already have a functioning version of SQLDeveloper 18.2 + Oracle Client 12 for more modern databases, but for this connection I want a separate older version of SQLDeveloper.
I've installed SQLDeveloper 3.2.20.09 in a separate folder on my machine and can launch it, but it defaults to finding the ojdbc6.jar file from Oracle Client 12. if I go to Help > About and select properties, the jdbc.library says jdbc.library /C:/app/client/product/12.1.0/client_1/jdbc/lib/ojdbc6.jar
and if I try to connect I get the error ORA-01460: unimplemented or unreasonable conversion requested
I tried putting the path to the SQL Developer 3.2 install first in the PATH variable, but no difference. Is there a way to tell SQL Developer which jdbc driver to use for Oracle ? (maybe in sqldeveloper.conf)
The official answer is:
use the jar (driver) we ship with the product OR
use a Thick Client, and we'll pull the jdbc driver from an Instant Client or Oracle HOME on your machine
The 2nd option will work so long as you don't try to go back back or forward in time to the point that the software will recognize/support the driver.
In other words, you can't tell SQL Developer 18.x to use a 9i Home, we have a hard dependency to require at least a 11gR2 client (I believe, it could actually be a 12c based client which is required).
You'd be better off getting your data out of that ancier 9i Database and into a modern 12 or 19c Oracle instance.
but it defaults to finding the ojdbc6.jar file from Oracle Client 12.
Sounds like you've managed to get a thick connection defined, go into preferences and disabled on the advanced page any reference to OCI or Thick, then it will use the jdbc driver shipped with SQLDev.

Why is PostgreSQL remembering my previous instalations?

Recently I installed PostgreSQL 10.4, but it was losing connection all the time. I uninstalled it, removed the data folder and installed version 9.6, which didn't help, so I uninstalled it as well and removed the data folder. I installed 10.4 again hoping that it will work well this time.
When I opened pgAdmin it showed as if version 9.6 was still installed apart form the 10.4 (which should be there). I tried creating a user in it (to see if it really works) and it created it successfully, but after further investigation I realized that it created the same user in the 10.4 installation. It must have been the same installation, but pgAdmin saw it as two separate ones. I deleted both installations form pgAdmin and reinstalled version 10.4.
Everything works fine now, but I still wanted to ask what might have caused this issue? Can it cause problems for my existing db in the future?
It's not "PostgreSQL" that remembered the installation. It's pgAdmin where you simply didn't delete the configured connection. Connection information is something specific to the SQL client, not the database server.
The existing connection definition uses the same hostname, port and apparently password that was valid for a running 9.6 server or the new Postgres 10 server. The name of that "server" is something that is specified in pgAdmin and has nothing to do with the actual Postgres installation. You could have named the "9.6 Server" connection "Connect to some nice DBMS" instead.
That information is not stored together with the PostgreSQL installation, but in your user profile.

Migrating Postgresql 9.1 to 9.2 from an old server to a new server

In my old server, Postgresql 9.1 is installed and it contains a large scale of data. Now, I have got a new server and installed the latest version of Postgresql which is 9.2. I want to migrate the whole data from the old server to the new server. I looked at Postgresql documentation and there is a command to upgrade but it seems to explain upgrading in the same server. How could I approach for this matter?
I would be very careful about changing both hardware and major versions of PostgreSQL at the same time. If something goes wrong, it will greatly complicate figuring out what the problem is.
I do this as a two step process, first restore the database to the new server as the same version, then run pg_upgrade. That means you have to have both versions of the software installed on the new server simultaneously.
Dump the database with pg_dump and load it at the new server with psql. I think pg_upgrade is better as an in place procedure.