0

Is it possible to migrate data between two different datastores using Dragonfly?

I'm currently storing images in the DB - using a custom relational data store, and want to migrate to an S3-like web API sore.

Kara
  • 6,115
  • 16
  • 50
  • 57
CambridgeMike
  • 4,562
  • 1
  • 28
  • 37

1 Answers1

2

The answer is in issue markevans/dragonfly #382 on github.

In short:

  • update Dragonfly configuration to new sorage
  • keep old storoage configuration in "named" config
  • you can access attachemnts from old storage by:

 

job = Dragonfly.app("filestore").fetch(model.attachment_uid)
model.attachment = job.to_file(job.name)

Another solution worth mentioning I found here https://gist.github.com/lassebunk/cce8b54d7d36da0960eb)

(@CambridgeMike it is probably your own issue, but recording answers for others here).

Lukas Svoboda
  • 588
  • 1
  • 4
  • 10