Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration from SQLite to MySQL/MariaDB #5280

Open
Bahama03 opened this issue Oct 29, 2024 · 5 comments
Open

Migration from SQLite to MySQL/MariaDB #5280

Bahama03 opened this issue Oct 29, 2024 · 5 comments
Labels
area:core issues describing changes to the core of uptime kuma feature-request Request for new features to be added

Comments

@Bahama03
Copy link

πŸ“‘ I have found these related issues/pull requests

Related to #5274, wanting to migrate to MySQL.

🏷️ Feature Request Type

Deployment

πŸ”– Feature description

With a correct db-config.json file pointing to the MySQL instance, the tables are created but it is treated as a new installation. No tables are migrated.
Tested this with a copy of the database and a separate container.

βœ”οΈ Solution

In my case I would like to migrate my current installation on the latest version of v1 to v2, but directly migrating/importing in MySQL instead of sqlite3.

❓ Alternatives

No response

πŸ“ Additional Context

No response

@Bahama03 Bahama03 added the feature-request Request for new features to be added label Oct 29, 2024
@CommanderStorm
Copy link
Collaborator

Please see https://github.com/louislam/uptime-kuma/wiki/Migration-From-v1-To-v2

Can I migrate my existing SQLite database to MariaDB?

Cannot be done directly. You will need to export your data from SQLite and import it into MariaDB using 3rd party tools.

TL;DR:
We don't currently have the (reviewer, support, triage, testing, ..) resources to build out the interop-tooling (incl. neessesary testing) surrounding this.

Not having this be part of the process is likely fine. v1 is quite limited in its scalablity (see #4500) anyways.
=> If you need the level of monitors that was previously not possible, you are going to be importing using the python wrapper / .. anyway. πŸ€·πŸ»β€β™‚οΈ

@derekoharrow
Copy link

It would at least be good to have a guide on how to export, convert and import from sqlite to MySQL/MariaDB. I tried this manually myself yesterday and couldn't get it to work.

@monster010
Copy link

It is possible to migrate, I did it manually and by manual I mean:

  • Create new Kuma instance (new folder, complete new installation)
  • Run installer (did not use embedded mariadb because embedded caused problems)
  • Opening kuma.db and manually transferring the data, making adjustments here and there because otherwise it doesn't work
    • For example, a dump from a SQLite contains '' instead of NULL. AUTO_INCREMENT is AUTOINCREMENT in SQLite and things like that.

I'm running MariaDB now and haven't noticed any problems so far.

@Apashh
Copy link

Apashh commented Oct 31, 2024

@monster010 nice !! It will be interesting to note this in Wiki migrate v1 SQLite to v2 Mariadb.

@CommanderStorm
Copy link
Collaborator

CommanderStorm commented Oct 31, 2024

Sorry, but as stated above:
We don't have the resources to support this part. We still don't have the resources to maintain this part, even if it were to live in the wiki.

If you/somebody else creates a gist with an update script, that is fine for us though, we can link that.

@CommanderStorm CommanderStorm changed the title Migration to v2 directly to MySQL Migration from SQLite to MySQL/MariaDB Nov 2, 2024
@CommanderStorm CommanderStorm added the area:core issues describing changes to the core of uptime kuma label Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core issues describing changes to the core of uptime kuma feature-request Request for new features to be added
Projects
None yet
Development

No branches or pull requests

5 participants