Migrate app from SQLite to LiteFS

Launched an app on 1 machine.

The app has a volume for a SQLite database with one table and about 21 rows. At most the data will get modified about once a year.

I’d like to add another machine to another region where more traffic has started to originate form.

I thought I’d use LiteFS across the machines so I don’t have to copy sqlite files.

I went through the process shown here.

Edited my fly.toml to have this in it.

[mounts]
  source = "litefs"
  destination = "/var/lib/litefs"
  processes = ["app"]

When I got to deploy I get the following error:
Error: machine 2874290a005918 [app] can't update the attached volume litefs with name 'vol_r6gzommj2gz7d3dv' by 'cb_checkout_sqlite'

Presumably because the machine is still attached to my old volume cb_checkout_sqlite?

Do I need to delete the machine and volume and redeploy?

Any help would be appreciated!

I’m far from an expert (just trying to get LiteFS running myself; see some other topics I’ve posted recently). But I was in your situation I think I’d try to export the current SQLite database (which should be easy as it’s so small and infrequently updated) and then recreate your app with a litefs volume and some startup code that will load the exported database. That should get you and your old into the LiteFS world.

But maybe there’s a much better way to promote a non-LiteFS SQLite into a LiteFS one that someone will tell us about.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.