xWiki 6.3. changing database (HSQL to PostgreSQL) and migrating data - postgresql

I have an instance of xWiki 6.3 running on default database i.e. HSQL.
I need to move it to PostgreSQL database.
I have installed PostgreSQL and have followed following steps from documentation to point xWiki 6.3 to my new PostgreSQL database.
1 - Copied jdbc drivers at required path in xwiki
2 - In xwiki.cfg file, I have un-commented following two lines
xwiki.store.migration=1 (was already un-commented)
xwiki.store.migration.databases= all
3 - commented hsql related section in hibernate.cfg.xml and have un-commented and updated PostgreSQL related section with required information.
After that, once I start my xWiki 6.3 instance, it shows me a home page with Add Button. However none of the existing content is visible.
I can see that all the tables are moved to postgreSQL if I connect to Database.
Also, I am unable to login with the admin account that was working when the application was running on hsql.
Any idea if I am missing something ?
Regards,

I don't think your process will port any existing data (i.e. the rows, ather than the tables) from one database to the other, not least because your configuration will only know about one database at a time. I suggest you follow the guidelines to export your content as a XAR while configured for HSQL and then import it again once you've reconfigured for PostgreSQL.

Related

You have specified a database that is not empty, please specify an empty database

I'm trying to connect to an RDS cluster in AWS that's an Aurora PostgreSQL database. It's a brand-new database that I created along with the instances that I have Jira deployed to. However, when I try to connect to the instance from the Jira configuration screen I get this error
You have specified a database that is not empty, please specify an empty database.
I haven't touched this database at all, why is it giving me this error? I have one read and one write database in my cluster and the "hostname" is the endpoint for my write database, which is what the docs say. Could this be an issue with the Jira version I'm using?
This is the download link I'm using in my user-data script to install Jira. I'm also using PostgreSQL version 12.11
https://www.atlassian.com/software/jira/downloads/binary/atlassian-servicedesk-4.19.1-x64.bin
I switched to a different PostgreSQL version and now it's working.
PostgreSQL version 12.11 was giving me the error and switching to version 13.7 works as expected.

Why does running a query return 'table_oid' under messages and nothing under Data Output

Running any sort of query on pgAdmin 4 just returns a 'table_oid' under messages.
I am able to get the necessary data when running the query from the command line, for example
SELECT ST_MakePolygon(ST_GeomFromText('LINESTRING(75.15 29.53,77 29,77.6 29.5, 75.15 29.53)'));
I understand that table_oid refers to the object id of the table, but I have no idea how to access it.
Pardon me please if it is a simple question, but I am unable to find any resources online
Expected:
010300000001000000040000009A99999999C9524048E17A14AE873D4000000000004053400000000000003D4066666666666653400000000000803D409A99999999C9524048E17A14AE873D40
Actual:
table_oid
From pgAdmin 4 project tracker:
Temporary solution until next release and tested in my ubuntu 18.04 machine:
Replace these two 2 files:
/usr/share/pgadmin4/web/pgadmin/tools/sqleditor/__init_*_py
/usr/share/pgadmin4/web/pgadmin/tools/sqleditor/command.py
Link to files:
__init_*_.py
command.py
Note:
The first file's name is __init_*_py, without the *.
Try Squirrel SQL - Universal SQL Client. It's an extremely useful SQL client. I use it to access SQL Server, PostgreSQL, MySQL, Access. It's not as good looking as pgAdmin4.
Install JAVA first, if not already installed.
Install Squirrel SQL.
Download the latest PostgreSQL JDBC driver, e.g. postgresql-42.2.6.jar, and put it into a convenient location.
Open/Start Squirrel.
Click the Drivers Tab and scroll down to PostgreSQL. Double click PostgreSQL. A "Change Driver: PostgreSQL" dialog box/window will open.
Click the Extra Class Path tab and click the Add button. Navigate to and choose the PostgreSQL JDBC Driver that was downloaded in step 3. above.
Click the List Drivers button, "org.postgresql.Driver" should appear in the Class Name drop down box.
Click OK.
Setup PostgreSQL JDBC Driver
The driver should now be setup.
Click the Aliases tab to setup a connection to your database. See my example screenshots.
Setup Database Connection

Error installing Moodle 3.0

I am unable to complete Moodle installation. I am hosting the site on NearlyFreeSpeech and using PHP 5.6. Moodle doesnt seem to be able to connect to the database and write any tables.
I created the moodledata folder in /protected/moodledata and moodle is in /public/moodle
I receive this error after accepting the terms and conditions.
Error reading from database
More information about this error
It is usually not possible to recover from errors triggered during installation, you may need to create a new database or use a different database prefix if you want to retry the installation.
Normally my first instinct would point to the config.php file but if it's getting as far as telling you that a connection is established with the database but there's a read error ("Error reading from database"), then that generally means your config.php file is probably healthy, but your database is not.
Firstly, check that you're using one of the following database servers that Moodle is compatible with (minimum version)
PostgreSQL 9.1
MySQL 5.5.31
MariaDB 5.5.31
Microsoft SQL Server 2008
Oracle Database 10.2
source.
Secondly, ensure that the user assigned to access your database in config.php has ALL PRIVILEGES set on that database.
Moving on... If this is a fresh install and you have no data to lose, your best bet is to start with a clean database.
You can either delete your existing database and set up a new one, or you can drop all tables from your existing database.
Option 1. Delete your existing database.
Delete your config.php file
Jump to phpMyAdmin (from the 'actions' tab on the MySQL process page)
Click on "Databases"
Delete your existing database
Hit "Create database" to generate a fresh, empty database
Go to http://your.url/install.php and follow the instructions for a fresh install.
Option 2. Clear your existing database
Jump to phpMyAdmin and run the following query:
DECLARE #sql NVARCHAR(max)=''
SELECT #sql += ' Drop table '+TABLE_SCHEMA+'.'+ TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
Exec Sp_executesql #sql
source.
Then go to http://your.url/install.php and follow the instructions for a fresh install.
If you managed to start with a fresh database and you get the same error, please ensure that you have all the prerequisites available from your host. You can find a list of Moodle PHP requirements here.
The only time I've seen that error is when using the wrong MySQL version. Eg currently MySQL 5.5 is supported but if you have 5.1 you would get that error.
Source: http://realtechtalk.com/moodle_install_error_Error_reading_from_database_-2072-articles

TYPO3 Backend is locked! #1270853884: TYPO3 Fatal Error

My TYPO3 Backend is locked after i changed the password (root) in the phpMyAdmin Extension in the backend. After that everything was locked and i get this error: #1270853884: TYPO3 Fatal Error: The current username, password or host was not accepted when the connection to the database was attempted to be established!
But the InstallTool is not locked so can make changes in there.
I searched in the internet for some solution but didn't find anything helpful.
What can i do now?
First of all you should not connect your TYPO3-System with the MySQL root user to your specific database. Add a MySQL user that is only privileged to the needed TYPO3 database.
You can edit your database credentials within the TYPO3 Install Tool without being connected to the database.
The database connection credentials will be stored in:
TYPO3 4.x: typo3conf/localconf.php
TYPO3 6.x and later: typo3conf/LocalConfiguration.php
My problem was a corrupt innodb file. The table "tx_realurl_urlcache" was the reason. To solve the problem i just truncated this table and restarted mysql. After the restart everything worked again.
In detail:
Because the topics about changing typo3 config did not help me i checked the systems syslog file and found out the mysql system printed a lot of errors. Especially the entry "InnoDB: Database page corruption on disk or a failed" helped me finding out what my problem was.
By checking the database sizes i found out that the size of my typo3-database was very large (more than 1.5 GB). So i checked which tables use the space. The biggest one was tx_realurl_urlcache which used more than 1 GB. Because this is just a cache-table i truncated it and restarted the mysql service. This solved the problem.

MobileFirst install - cannot connect to database appcntr after it was created

Trying to install MobileFirst 6.3 (Using DB2 v 10.5, Windows Server 2012 R2 std) - and during the creation of the DB2 APPCNTR database stage, I get the error:
Creating database APPCNTR (this may take 5 minutes) ...failed:
Cannot connect to database 'APPCNTR' with user 'db2admin' after it was created: com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-1035, SQLSTATE=57019, SQLERRMC=null, DRIVER=4.17.29
This is a clean installation of DB2, with no other programs using it (that I know of). The db2admin user is a member of my windows security group 'DB2ADMS' as well as 'DB2USERS' just in case
If I go back in the installer, then press next again, it says the database is already created (not sure if it's fully successful or partial)....
I believe that the database has been created successfully but for some reason, it is not possible to connect to the database via JDBC.
The explanation for the error message can be found here -- it can be many reasons: http://www-01.ibm.com/support/knowledgecenter/SSEPGG_9.5.0/com.ibm.db2.luw.messages.sql.doc/doc/msql01035n.html
When that happens to me the issue is often resolved by waiting a bit and retarting Installation Manager. Restarting the DB2 instance helps also. (If you don't restart Installation Manager, it believes it needs to create the database and fails because the database was created).
If the problem is not resolved by waiting a bit, you can also create the database manually prior running install Manager using that procedure (use a different database name than the one that is considered busy):
https://www-01.ibm.com/support/knowledgecenter/SSHS8R_6.3.0/com.ibm.worklight.installconfig.doc/admin/t_creating_the_db2_database_for_App_Center.html
Then use that database name when running Installation Manager,