mirror of
https://github.com/healthchecks/healthchecks.git
synced 2026-04-25 06:55:53 +03:00
[GH-ISSUE #554] Database Migration #401
Labels
No labels
bug
bug
bug
feature
good-first-issue
new integration
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/healthchecks#401
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lettore on GitHub (Aug 22, 2021).
Original GitHub issue: https://github.com/healthchecks/healthchecks/issues/554
Hello, I'm running Healthchecks in Docker self hosted, I started with the builtin Sqlite database for testing, but now Healthchecks is vital for me.
I want to switch from Sqlite to Mysql for production use, but I don't want to configure again all the checks.
There's a way to export all the data and restore on a fresh installation using Mysql as database?
Thanks
@cuu508 commented on GitHub (Aug 23, 2021):
I don't have experience with this, and don't have solid advice to give. But here's two things to investigate.
Healthchecks is a fairly conventional Django app. You can expand the search to "how to migrate a Django app from one database type to another", and see what suggestions come up.
I once had to selectively restore one customer's account from a backup that was deleted by user mistake. To do this, I wrote two management commands. One command,
export.py, exports a single account's data in a JSON file. The other command,restore.py, reads the JSON file and inserts it in the database. The same approach may work for DB migration as well – export from SQLite, then import in MySQL.Here are the management commands I used – if you use them please be sure to check the migrated data is not missing anything. If you notice any weirdness, please let me know about it.
export.py:
restore.py: