Migrate form MySql to MariaDB

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
MESSI
Posts: 19
Joined: Thu Dec 29, 2022 11:09 pm

Migrate form MySql to MariaDB

Post by MESSI »

Hello folks,

Please advice.
I have migrated one of my servers from MySQL to MariaDB and I see that the IDs in DB are starting from 1 again. As I already have records in my apps
created with MySQL this will overcome with double IDs .
Please advice how to deal with this!
Thank you very much.
Screenshot_367.jpg
Screenshot_367.jpg (63.56 KiB) Viewed 1431 times
AwareIM 8.5, 8.7, 9.0 - MariaDB, Windows Server 2012,2019, 2022 Standard
customaware
Posts: 2405
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Migrate form MySql to MariaDB

Post by customaware »

Maria DB uses Sequences so have a look in your DB and you should see a table called bas_idgen_seq.

Now you need to know what the highest ID number was that you had previously in idgen file on MySQL.

Let’s say it was 14,508

Once you know that….

Park on the bas_idgen_seq table and run the following query on the DB

ALTER SEQUENCE BAS_IDGEN_SEQ RESTART WITH 15000

The 15000 is any number greater than you previous 14,508
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
MESSI
Posts: 19
Joined: Thu Dec 29, 2022 11:09 pm

Re: Migrate form MySql to MariaDB

Post by MESSI »

That's seems to work.

Thank you Mark.
AwareIM 8.5, 8.7, 9.0 - MariaDB, Windows Server 2012,2019, 2022 Standard
Post Reply