this post was submitted on 28 Dec 2024
1 points (100.0% liked)

Pleroma

112 readers
1 users here now

Place to discuss the fediverse platform, Pleroma.

Ask questions, or share your tips and information here!

founded 4 years ago
MODERATORS
 

@pleroma@lemmy.ml

I cannot find any documentation for how to install pleroma using sqlite driver instead of postgres. I already know how to do the standard installation with postgres but I want to use sqlite instead.

I need help with installing and running via sqlite backend and tips on how to minimize database storage size. Is there any documentation on this? Has anyone done it?

#Akkoma #Pleroma #Sqlite #Fediverse

top 2 comments
sorted by: hot top controversial new old
[–] davel@lemmy.ml 0 points 5 days ago

For future postings to Lemmy, please understand that the first line becomes the title of the post. If put nothing on the first line but “@pleroma@lemmy.ml”, then your post essentially has no title, which Lemmy users will find annoying.

https://lemmy.ml/post/24144895

[–] stinky@redlemmy.com 0 points 5 days ago

In your mix.exs file, ensure you have the SQLite adapter:

defp deps do [ {:ecto_sql, "~> 3.9"}, {:ecto_sqlite3, "~> 0.10"}, # ...other Pleroma dependencies ] end

In your config/prod.exs (or dev.exs/test.exs as appropriate):

config :pleroma, Pleroma.Repo, adapter: Ecto.Adapters.SQLite3, database: "/var/lib/pleroma/pleroma.sqlite3", pool_size: 5

Then, in the terminal, run migrations:

mix ecto.create mix ecto.migrate

Start the server:

mix phx.server Hello! There’s no official Pleroma documentation for a full SQLite install, but it is feasible by swapping out the Postgres adapter for Ecto.Adapters.SQLite3. The main points to watch for:

Dependencies: Add the ecto_sqlite3 dependency. Configuration: Update the :pleroma, Pleroma.Repo settings to point to Ecto.Adapters.SQLite3 and specify a path for the SQLite file. Migrations: Run your migrations with mix ecto.create and mix ecto.migrate. Minimizing DB storage

Use VACUUM periodically to reclaim unused space: elixir Copy code Pleroma.Repo.query!("VACUUM;") Prune old posts and media attachments. Pleroma’s configuration allows for limiting media retention, so consider adjusting instance.remote_post_retention_days (and similar) to reduce stored data. Keep an eye on logs or ephemeral data that might accumulate in the database. Tuning relevant config entries (for example, disabling certain analytics features or adjusting retention settings) can help keep your SQLite file size low. Hope this helps!