Migrating mariadb 10.1 databases to a mariadb 10.3 database - import

I have a sql dump file generated by mysqldump of a mariadb 10.1 database
I have set up a new db server using mariadb 10.3 and am trying to import data and structure coming from the sql dump file. I get many errors like :-
**You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '
INDEX user_id (user_id ASC) VISIBLE,
INDEX item_id (item_id ASC)...' at line 17.
SQL Error: 1064
Creating table event-afs-u-139492.wp_bp_activity_meta**
My question is, Is there anyway of upgrading the 10.1 SQL dump file to 10.3 before importing ?
Thanks in advance for any help.

Related

Upgrade postgresql 9.6 -> postgresql 13 blocked by missing plpython2 extension, but I can't seem to remove the extension

I'm trying to upgrade a system from Postgresql 9.6 to Postgresql 13 using pg_upgrade shipped with Postgresql 13. This upgrade fails with the error:
Your installation references loadable libraries that are missing from the new installation. You
can add these libraries to the new installation,
or remove the functions using them from the old installation. A list of
problem libraries is in the file:
loadable_libraries.txt
Failure, exiting
-bash-4.2$ cat loadable_libraries.txt
could not load library "$libdir/plpython2": ERROR: could not access file "$libdir/plpython2": No such file or directory
In database: infohub
This error seems clear to me, the infohub database uses the plpython2 extension, which isn't installed (and doesn't even exist) for postgresql 13.
My problem is that I've tried removing the extension and pg_upgrade still fails with the above error.
postgres=# \c infohub
psql (13.0, server 9.6.19)
You are now connected to database "infohub" as user "postgres".
infohub=# DROP EXTENSION plpythonu CASCADE ;
DROP EXTENSION
I tried using this statement to check if there are any function
infohub=# select DISTINCT l.lanname as function_language
from pg_proc p
left join pg_language l on p.prolang = l.oid
;
function_language
-------------------
internal
sql
c
plpgsql
(4 rows)
Best I can tell, there are no functions that depend on plpythonu (or plpython2), however pg_upgrade still gives me the above error about a missing extension.
Any help or idea would be greatly appreciated.
Run the following statement in all databases:
SELECT oid::regprocedure
FROM pg_catalog.pg_proc
WHERE probin = '$libdir/plpython2';
Then you know which functions are at fault and can remove them.

Restore DB2 10.5 FixPackge 10 to DB2 11.5 failed

I have a database file backup from DB2 10.5 fix package 10, Now I do want to restore it into DB2 11.5 developer edition to do a test.
But got below issue:
SQL2519N The database was restored but the restored database was not
upgraded to the current release. Error "-440" with tokens "SQLERRM
FUNCTION " is returned.
I use below commands, both no success.
db2 restore database DBNAME01 from /tmp/backups without prompting
db2 restore database DBNAME01 from /tmp/backups replace existing
When I try to use:
db2 restore database DBNAME01 from /tmp/backups
I got:
> SQL0440N No authorized routine named "SQLERRM" of type "FUNCTION" having
> compatible arguments was found. LINE NUMBER=1. SQLSTATE=42884
Can someone help?
You can only restore from offline backup; try this.

Getting Invalid schema name error on postgresql RDS after upgrading from 9.3 to 9.4

As pointed by amazon that PostgreSQL 9.3 is deprecated and need to upgrade our version of PostgreSQL to upper version, we just upgraded our version to 9.4. But after upgrade we are not able to do any save() operation from your Yii 1.1 project locally but the operation is working fine from the server.
When we try to run our project from locally and connect the remote PostgreSQL, we got the below error.
{"error":"SQLSTATE[3F000]: Invalid schema name: 7 ERROR: schema
\"publicubfo06sm23qicfa8kmm0nrv3td81qf928i\" does not
exist","try":"end"}
When I try to see my existing schemas using,
SELECT table_name FROM information_schema.tables
I got 3 values namely 'public','pg_catalog', 'information_schema'
Also want to mention that previously with our version 9.3 we were able to do model operations on Yii 1.1 like $model->save() and then immediately get back the primary key value using $model->id or $model->getPrimaryKey() but now it is not working. Only the $lastId = Yii::app()->db->getLastInsertID('tbl_user_group_id_seq'); way is working now.
Can anyone point me out what is the reason behind it? is something get lost while upgrading from 9.3 to 9.4 like schema, role, sequence or anything else that is causing the errors now to access my RDS from local machine.

Druapl show unserialize() error after restore database

The Drupal version is 7.34
Database is PostgreSQL 9.3.3
PHP is 5.4.39
Testing restore database at shared web hosting (restore the whole database after delete it)
No error if I just restore the records (empty all the tables records)
Show below error after restore database
Notice: unserialize(): Error at offset 0 of 13 bytes in variable_initialize() (line 936 of /home/www/mywebsite.me/includes/bootstrap.inc).
There're more error like the above line, I just skip them for brevity.
These error all related to the table with a field that has bytea type.
I also have a development environment built up by myself. No such error occur. Although the PostgreSQL and PHP version is different to what the shared web hosting provided to me.
Development environment PostgreSQL is 9.3.5

Postgresql error: could not open segment 1 of relation base/20983/2416

I'm running a Postgresql query and getting the following error:
ActiveRecord::StatementInvalid (PGError: ERROR: could not open segment 1 of relation base/20983/24161 (target block 5046584): No such file or directory
The query is of the format 'SELECT "locations".* FROM "locations" WHERE ("locations"."id" IN (115990, 78330, 77891, 78248, ...)' with about 600 ids in the IN clause - not an optimal query I know but it's what I have to work with for the moment!
The server is running PostgreSQL 8.4.6 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Ubuntu 4.4.1-4ubuntu9) 4.4.1, 64-bit. Postgis 1.5 is also installed, and the locations table contains a geometry column.
Anyone have any idea what could be causing the error? Thanks!
That error indicates serious database corruption, one of the database's files containing the table data (of something in the system catalogue?) is missing. I doubt you'll be able to do much beyond restoring the data from a backup.