Okay, I just followed your advice and the output does look hopeful. First, I entered the Discourse container:
$ cd /var/discourse
$ sudo ./launcher enter app
WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed
Please be patient
Unable to find image 'discourse/base:2.0.20190625-0946' locally
2.0.20190625-0946: Pulling from discourse/base
Digest: sha256:9899c60721649460283ac800836ac1ebecbc3ed8a97a496e514cf8c97f5b6d82
Status: Downloaded newer image for discourse/base:2.0.20190625-0946
Next, I ran rake posts:missing_uploads
:
# rake posts:missing_uploads
Looking for missing uploads on: default
Fixing missing uploads:
.........................................................................................................................................................................................................................................................
12 post uploads are missing.
12 uploads are missing.
1 of 12 are old scheme uploads.
3 of 8930 posts are affected.
(Only 12 missing post uploads this time! Nice!)
Finally, I set SiteSetting.migrate_to_new_scheme
equal to true
and exited the Rails console:
# rails c
[1] pry(main)> SiteSetting.migrate_to_new_scheme
=> false
[2] pry(main)> SiteSetting.migrate_to_new_scheme = true
=> true
[3] pry(main)> exit
After some time had passed, I confirmed that the value of SiteSetting.migrate_to_new_scheme
had indeed changed to false
and ran rake posts:missing_uploads
again:
[1] pry(main)> SiteSetting.migrate_to_new_scheme
=> false
[2] pry(main)> exit
# rake posts:missing_uploads
Looking for missing uploads on: default
Fixing missing uploads:
.
12 post uploads are missing.
12 uploads are missing.
1 of 12 are old scheme uploads.
3 of 8939 posts are affected.
The output is more or less the same, so I think that’s supposed to mean that all the posts using the old upload scheme have been migrated to the new upload scheme. However, the uploads directory still has a lot of numbered subfolders:
$ cd /var/discourse/shared/standalone/uploads/default/
$ ls
1 112 125 138 151 164 177 190 203 216 229 242 255 268 281 294 46 59 72 85 98
100 113 126 139 152 165 178 191 204 217 230 243 256 269 282 34 47 60 73 86 99
101 114 127 140 153 166 179 192 205 218 231 244 257 270 283 35 48 61 74 87 optimized
102 115 128 141 154 167 180 193 206 219 232 245 258 271 284 36 49 62 75 88 _optimized
103 116 129 142 155 168 181 194 207 220 233 246 259 272 285 37 50 63 76 89 original
104 117 130 143 156 169 182 195 208 221 234 247 260 273 286 38 51 64 77 90
105 118 131 144 157 170 183 196 209 222 235 248 261 274 287 39 52 65 78 91
106 119 132 145 158 171 184 197 210 223 236 249 262 275 288 40 53 66 79 92
107 120 133 146 159 172 185 198 211 224 237 250 263 276 289 41 54 67 80 93
108 121 134 147 160 173 186 199 212 225 238 251 264 277 290 42 55 68 81 94
109 122 135 148 161 174 187 200 213 226 239 252 265 278 291 43 56 69 82 95
110 123 136 149 162 175 188 201 214 227 240 253 266 279 292 44 57 70 83 96
111 124 137 150 163 176 189 202 215 228 241 254 267 280 293 45 58 71 84 97
What would be the easiest way to figure out which (if any) posts are referencing the images in those subfolders? A simple Rails console query would be fine.
Thanks!