Ho creato una copia di backup senza i file caricati.
Poi ho copiato manualmente solo le vecchie immagini da standalone/uploads/default/original/1X/* nella stessa cartella (sul mio hosting).
Esiste un comando che crei le immagini nella cartella ottimizzata (al momento non ci sono ancora avatar né immagini nei post)? È tutto ciò che serve per rigenerare le immagini? Come farlo correttamente? Il comando “rebake post” non aiuta, né altri comandi. Aggiungo che è stato configurato anche un bucket S3 per i file.
The following should work as long as you didn’t change the hostname.
Enter the rails console:
cd '/var/discourse
./launcher enter app
rails c
Execute the following:
DB.exec("TRUNCATE TABLE optimized_images")
SiteIconManager.ensure_optimized!
User.where("uploaded_avatar_id IS NOT NULL").find_each do |user|
Jobs.enqueue(:create_avatar_thumbnails, upload_id: user.uploaded_avatar_id)
end
DB.exec(<<~SQL)
UPDATE posts
SET baked_version = NULL
WHERE id IN (SELECT post_id FROM post_uploads)
SQL
And then exit the rails console and execute a rake task: