# Upgrading Ghost from SQLite to MySQL: guide

**URL:** <https://forum.ghost.org/t/upgrading-ghost-from-sqlite-to-mysql-guide/53592>\
**Category:** Developer help\
**Created:** [December 25, 2024, 1:42pm UTC](https://forum.ghost.org/t/upgrading-ghost-from-sqlite-to-mysql-guide/53592 "2024-12-25T13:42:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rozhok](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/rozhok/32/11569_2.png) [@rozhok](https://forum.ghost.org/u/rozhok)\
**Post date:** [December 25, 2024, 1:42pm UTC](https://forum.ghost.org/t/upgrading-ghost-from-sqlite-to-mysql-guide/53592/1 "2024-12-25T13:42:54Z")

</div>

Recently, I finally managed to upgrade my old Ghost instance running the 4.x.x release on SQLite to the latest 5.x.x release on MySQL.

I had attempted this upgrade multiple times without success, but now everything works perfectly. Here’s how I did it:

1. Backup everything, just in case.
2. Upgrade to version `5.8.3`. AFAIK this is the latest version that still supports SQLite.
3. Set up a fresh MySQL instance.
4. Create the database and user.
  - Create a database named `ghost`.
  - Create a user `ghost` with the appropriate permissions for the `ghost` database.
  - Use the collation `utf8mb4_0900_ai_ci` for the database.

5. Modify your `config.production.json` file to point to the new MySQL instance:

```auto
  "database": {
    "client": "mysql",
    "connection": {
      "host": "your-mysql-host.domain.com",
      "user": "ghost",
      "password": "password",
      "database": "ghost",
    }
  },

```

1. Restart Ghost. Ghost will run migrations on the new database and create the required tables.
2. Download the `ghost.db` SQLite database file from your Ghost instance.
3. Download and install the [sqlite3-to-mysql](https://github.com/techouse/sqlite3-to-mysql) tool.
4. Run `sqlite3mysql --sqlite-file 'ghost.db' --mysql-host your-mysql-host.domain.com --mysql-user ghost --mysql-database ghost --mysql-skip-create-tables --without-foreign-keys --mysql-truncate-tables`. This tool will populate your MySQL database using the backup.
5. Restart Ghost, Check that everything is running smoothly.
6. Perform incremental upgrades. I didn’t attempt to upgrade in one leap. Instead, I upgraded in steps: `5.8.3`→`5.39.0`→`5.57.2`→`5.76.1`→`5.105.0`
7. …
8. PROFIT!

I know the official guides recommend a full reinstall, but I preferred avoiding the hassle of dealing with media files and other settings.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![rozhok](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/rozhok/32/11569_2.png) [@rozhok](https://forum.ghost.org/u/rozhok)\
**Post date:** [December 25, 2024, 1:46pm UTC](https://forum.ghost.org/t/upgrading-ghost-from-sqlite-to-mysql-guide/53592/2 "2024-12-25T13:46:54Z")

</div>

Considering the improvements SQLite has made over the last few years, I think it’s really unfortunate that Ghost has dropped support for it. While MySQL is a popular and well-known tool, it still represents a significant dependency: one more server, one more piece of software, and one more potential headache.

---

<div class="post-metadata">

**Author:** ![razvanphp](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/razvanphp/32/35946_2.png) [@razvanphp](https://forum.ghost.org/u/razvanphp)\
**Post date:** [April 30, 2025, 5:43am UTC](https://forum.ghost.org/t/upgrading-ghost-from-sqlite-to-mysql-guide/53592/3 "2025-04-30T05:43:47Z")

</div>

I’m also wondering about the deprecation of sqlite, what exactly is not supported? Given that:

> SQLite supports the JSON5 standard since the 3.42.0 version. 12 Feb 2024

Since some of us are developers, maybe we can do a community support for this, small blogs don’t need a separate databse server.

I can volunteer!  
R

---

<div class="post-metadata">

**Author:** ![wchesley](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/wchesley/32/38286_2.png) [@wchesley](https://forum.ghost.org/u/wchesley)\
**Post date:** [October 26, 2025, 3:38am UTC](https://forum.ghost.org/t/upgrading-ghost-from-sqlite-to-mysql-guide/53592/4 "2025-10-26T03:38:20Z")

</div>

Just wanted to clarify that sqlite is still supported. I have a dev instance using sqlite and found this page while researching how to migrate my sqlite db to MySQL for a production instance.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [October 26, 2025, 7:39pm UTC](https://forum.ghost.org/t/upgrading-ghost-from-sqlite-to-mysql-guide/53592/5 "2025-10-26T19:39:19Z")

</div>

sqlite3 is only supported in development. There is at least one bug I’m aware of with sqlite3 date encoding that means you wouldn’t want to run it in production. There may be more. You don’t need a separate database server, but you very much should run mysql for anything you care about.

---

<div class="post-metadata">

**Author:** ![rozhok](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/rozhok/32/11569_2.png) [@rozhok](https://forum.ghost.org/u/rozhok)\
**Post date:** [January 4, 2026, 8:54pm UTC](https://forum.ghost.org/t/upgrading-ghost-from-sqlite-to-mysql-guide/53592/6 "2026-01-04T20:54:35Z")

</div>

> you very much should run mysql for anything you care about

Well, there is zero reasons to run mysql for a what is actually a static site given the options like [LiteStream](https://litestream.io/). Instead, I’m forced to run my own mysql (because managed options are expensive), manage backups and upgrades instead of taking care of a single file.

I get where it comes from, self-hosted people like me are not a target audience of ghost, and dual-db support is a unnecessary overhead for a dev team trying to make some money out of it.

Still sad.

P.S.: MySQL is resource hog. My entire blog is fit into less than 50MiB, however, MySQL requires at least 512MiB of RAM for a what can be fit into a fraction of it.

---

<div class="post-metadata">

**Author:** ![muratcorlu](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/muratcorlu/32/38509_2.png) [@muratcorlu](https://forum.ghost.org/u/muratcorlu)\
**Post date:** [January 4, 2026, 10:48pm UTC](https://forum.ghost.org/t/upgrading-ghost-from-sqlite-to-mysql-guide/53592/7 "2026-01-04T22:48:45Z")

</div>

> [@rozhok](#):
>
> I get where it comes from, self-hosted people like me are not a target audience of ghost, and dual-db support is a unnecessary overhead for a dev team trying to make some money out of it.

One of the biggest challenges of making an open-source project is maintaining features that you -as the core developer- don’t use at all. You always rely on others or you need to learn those even though you don’t -want to- use it. That’s a big friction.

I made some open source projects and was always open any type of contributions, if they just pass the tests and have some documentation. But since I have no clue if that feature contributed by someone else that I don’t use at all, still works, it’s always hesitating to make a change and a release without breaking those features. If you have more and more parts those are not under your control, then at some point you got stuck. I think Ghost team also feels similar and tries to avoid this.

> [@rozhok](#):
>
> P.S.: MySQL is resource hog. My entire blog is fit into less than 50MiB, however, MySQL requires at least 512MiB of RAM for a what can be fit into a fraction of it.

I am also not a fan of MySQL. I personally prefer Postgres on all of my projects (including Synaps Media). Yes, a simpler DB server with less resource usage could be used in Ghost. But some can say similar things about Node.js too. Rust could run with 10MB of memory, instead of 300MB. At the end, these are the comfort zones of the core developers, right? And Ghost is not a technical fantasy project, it’s completely focused on a product mission: Making the best blogging/newsletter software. This mission is about the end product, not the technology behind. Making open-source and enabling self-hosting is also part of the mission, and yes, “easy to self-host” would be an important parameter. But we can argue that, MySQL is the most well-known DB solution out there for self-hosted environments. It uses a few hundreds of more RAM but ecosystem around it is huge. There are thousands of mysql hosting services by variety of prices. And many tools for managing mysql.

And please consider this: If Ghost team works on supporting multi-db architecture, by spending weeks (or months) on it, the only benefit would be a little more available resources on some self-hosted environments (arguably, many self-hosters would still prefer Mysql). But instead, if Ghost team works on -let’s say- comment moderation, internal review notes on Ghost editor, previewing themes… (you probably have more wishes too), then “everyone” would benefit from that effort.

So, I think the decision of the core team about sticking to MySQL can’t be summarized to make more money out of it. Instead, I think it’s more related to where to spend their -limited- money (a.k.a. time) at the current stage.

* * *

I think it also worths to quote @Hannah’s explanation here about DB support with the Ghost v5 release:

> Over the coming months we plan to deliver a range of DB optimisations and other improvements leveraging MySQL8 features. As a small team, we’re not able to commit to providing optimisation and compatibility fixes across a wide range of databases where knex does not provide interoperability and therefore for 5.0 we are clarifying that we only officially support MySQL8.
> 
> If anyone is interested in contributing to the long term maintenance of interoperability with other databases, we’d love to work with you.
> 
> [Ghost 5.0: Breaking Changes · Issue #14446 · TryGhost/Ghost · GitHub](https://github.com/TryGhost/Ghost/issues/14446)

---

<div class="post-metadata">

**Author:** ![rozhok](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/rozhok/32/11569_2.png) [@rozhok](https://forum.ghost.org/u/rozhok)\
**Post date:** [January 5, 2026, 9:36pm UTC](https://forum.ghost.org/t/upgrading-ghost-from-sqlite-to-mysql-guide/53592/8 "2026-01-05T21:36:46Z")

</div>

> [@muratcorlu](#):
>
> There are thousands of mysql hosting services by variety of prices.

Actually, not that much. Cheapest options starting from 15$/month, except of free tiers of major clouds.
