Closed varvello closed 6 months ago
Hi @varvello. That's not a simple question, unfortunately. What you should try first is:
If you don't do crazy things with Fuel, that should hopefully work.
Hello, the versions sound so close! I wonder if just removing the FLBadVersion
check workaround the problem of @varvello.
That error check was (is?) too strict and restrictive... the rationale was: as Fuel only can guarantee correct materialization if the version of the .fuel file and the FlMaterializer
are exactly the same, then let's signal an error if the versions don't match, to prevent wrong materializations.
Or change the version string ;)
Hi Guys, I solved it.
My idea was like @theseion already suggested i.e. materialize objects with the old version of fuel, load Fuel3.0.3 and then serialize all the objects.
As I already mentioned, this code https://theseion.github.io/Fuel/format-migration/ is obsolete but I followed its main idea.
Basically I changed:
(ConfigurationOfFuel project version: newVersion) load.
serializerClass := Smalltalk at: #FLSerializer.
with:
Metacello new
repository: 'github://theseion/Fuel:3.0.3/repository';
baseline: 'Fuel';
load.
BUT
The first attempts gave me LGit_GIT_ENOTFOUND error, I don’t know why, I searched on the web and found this post https://github.com/pharo-vcs/iceberg/issues/320#issuecomment-293386898 but no other reference. Probably the repo was down (?!?) I had no idea. After some attempts that error disappeared. Gosh!
An other error during loading of the new Fuel version was MetacelloConflictingProjectError
. After some trial and error I discovered I should have add onConflictUseIncoming
when loading the new version of Fuel
So the code became:
Metacello new
repository: 'github://theseion/Fuel:3.0.3/repository';
baseline: 'Fuel';
onConflictUseIncoming;
load.
Finally I put all my old 3.0.0 serialized objects in a dir and migrate the new 3.0.3 objects in a brand new dir. The code is:
allPreFilenames := (FileLocator imageDirectory resolve / 'fuel300’) fileNames.
objectsByFileName := Dictionary new.
allPreFilenames do: [ :fileName |
objectsByFileName
at: fileName
put: (FLMaterializer materializeFromFileNamed: (FileLocator imageDirectory resolve / 'fuel300'/ fileName) pathString) ].
Metacello new
repository: 'github://theseion/Fuel:3.0.3/repository';
baseline: 'Fuel';
onConflictUseIncoming;
load.
objectsByFileName keysAndValuesDo: [ :fileName :objects |
FLSerializer
serialize: objects
toFileNamed: (FileLocator imageDirectory resolve / 'fuel303’/ fileName) pathString.
].
That's it!
@theseion if you can, please change the code https://theseion.github.io/Fuel/format-migration/ with mine
Glad it worked and thanks for the detailed feedback. I will update the documentation.
Glad it worked and thanks for the detailed feedback. I will update the documentation.
Thank you very much @theseion. A couple more thoughts:
1) Do you have any explanation about the LGit_GIT_ENOTFOUND error?
2) I also tried to migrate from fuel 3.0.0 to fuel 5.2.2 in Pharo 8 and consequently from fuel 3.0.3 to fuel 5.2.2 in Pharo 10 and... it worked!!
Of course you have to add onConflictUseIncoming
on both the environments when loading the 5.2.2 version of Fuel
Metacello new repository: 'github://theseion/Fuel:5.2.2/repository'; baseline: 'Fuel'; onConflictUseIncoming; load.
So the sequence is: On Pharo8
then On Pharo10
I've updated the documentation on migration and upgrading, thanks @varvello.
Do you have any explanation about the LGit_GIT_ENOTFOUND error?
A lot of work has gone into the FFI, the bindings to LibGit2 and Iceberg since Pharo 8. Back then, that was all still pretty experimental (the FFI, for example, was completely redesigned). So I'm not surprised that you saw some spurious errors.
I also tried to migrate from fuel 3.0.0 to fuel 5.2.2 in Pharo 8 and consequently from fuel 3.0.3 to fuel 5.2.2 in Pharo 10 and... it worked!!
That's awesome! I wouldn't have suspected that to work, honestly. I've mentioned it in the docs.
🙏
p.s. The page https://theseion.github.io/Fuel/format-migration/ is down now
I've updated the documentation on migration and upgrading, thanks @varvello.
Do you have any explanation about the LGit_GIT_ENOTFOUND error?
A lot of work has gone into the FFI, the bindings to LibGit2 and Iceberg since Pharo 8. Back then, that was all still pretty experimental (the FFI, for example, was completely redesigned). So I'm not surprised that you saw some spurious errors.
I also tried to migrate from fuel 3.0.0 to fuel 5.2.2 in Pharo 8 and consequently from fuel 3.0.3 to fuel 5.2.2 in Pharo 10 and... it worked!!
That's awesome! I wouldn't have suspected that to work, honestly. I've mentioned it in the docs.
The page https://theseion.github.io/Fuel/format-migration/ is down now
Yes, I've renamed the page. "Format migration" didn't really fit the content.
and the link at the new page is…
The page https://theseion.github.io/Fuel/format-migration/ is down now
Yes, I've renamed the page. "Format migration" didn't really fit the content.
Hi Guys, How can I migrate from Fuel version 3.x.x to another one? The https://theseion.github.io/Fuel/format-migration/ documentation is obsolete!
I want to migrate from: Fuel on Pharo8, FLSerializer class>>currentVersion returns 300 to: Fuel on Pharo10, FLSerializer class>>currentVersion returns 303
Can you help me please?
TIA Davide