I have (successfully, as far as I can tell) used the update script I wrote. Added about 6GB of images I missed the first time around, and fixed up formatting and tags.
I’ll commit it to my current branch. I will not expect to include it when I submit a PR; I’ll be rebasing my work onto a new branch for the PR.
https://github.com/johnsonm/discourse/blob/friendsmegplus/script/import_scripts/friendsmegplus-update.rb
My branch now has category creation from @pfaffman in it, based on a documented boolean at the top of the script.
I have neither tested the change nor merged up to latest, because I don’t currently have imports to run and we’re still waiting for the dust to settle on the beta6 changes before moving forward on makerforums. Let me know if you have any problems.
Update 8 April:
PR opened
https://github.com/discourse/discourse/pull/7334
The fixup script seemed to work, but I missed something, and all the images and videos I uploaded were clearly not marked as uploaded and were tombstoned and garbage-collected. So 7.5GB of images and videos that I restored have gone away. The only exceptions I find are posts the I edited by hand.
I believe that the problem was that I saved the post and tried to schedule a rebake by setting rebake_version
to nil instead of calling Post.revise()
@Celeste_W @adorfer @Rafa @lapwingg @irek Please note that I have pushed a new version of the script/import_scripts/friendsmegplus-update.rb
script that I believe will fix this bug. If you have already run the friendsmegplus-update.rb script you will want to run it again with the updated version. I’ll keep testing it, and I might come up with more fixes; I’ll plan to update when I have more information. It’s at least more promising in testing so far.
My current version, because it uses Post.revise
, sends users notifications of system edit for every modification. In one sense that’s ok, but because this is happening to the majority of over 50000 topics, the most active users will have their notification widget spammed and made useless across the update. Wish I knew a better way!
I finished running it successfully. My latest edit handles posts to deleted topics correctly. It seems to have worked right. It shows revisions so I can compare to see what changes it made, and this gives me confidence that 7.5GB of images and videos won’t be tombstoned this time.
I just wrote up the process I used, after realizing that more people might benefit from it. Hopefully this satisfies the requests for documentation I’ve seen somewhere earlier in this massive thread! Feel free to ask questions here and I’ll plan to update my documenting blog post with additional details.