discourse/script
JsBergbau a225da4fd3
DEV: Enhance MyLittleForum importer (#34696)
This extends the **MyLittleForum (MLF) importer** with several optional features to make migrations more complete and reliable.

### New Features (optional via environment variables)
 **Uploads import**: supports attachments and images from the MLF uploads table.  
  - Imported uploads are stored with relative links, ensuring they continue to work even if the forum domain changes.  
- **Legacy link rewriting**: absolute links (`index.php?id=...`) are converted into working Discourse permalinks.  
  - Rewritten links are also created as relative links, so they remain valid after a domain move.  
- **Parent category option**: all imported MLF categories can be placed under a chosen existing category.  
- **Upload repair pass / incremental imports:** already-imported posts can be rescanned to fix broken or newly available upload references, allowing the importer to be run again later with a more up-to-date dataset.  
- **Relaxed upload constraints**: temporarily increases file size limits and allows all extensions during the import step.  

### Other Improvements
- Adjusted for MyLittleForum 2.x schema changes (e.g. `user_location` instead of `user_place`).  
- User import now respects already staged users; avoids errors that would otherwise occur when trying to create them again.  
- Improved BBCode → Markdown conversion: lists and quotes are converted more reliably.  
  - Especially improves handling of quotes at the beginning of posts and ensures following text is not mistakenly included in the quoted block.  
- Thread interlinking restored: legacy links between threads are now rewritten to point to the correct Discourse topics.  

### Environment Variables
- `PARENT_CATEGORY` – import all categories under an existing Discourse category.  
- `REWRITE_LINKS` – rewrite absolute legacy links.  
- `UPLOADS_DIR` – path to the MLF uploads directory (flat namespace).  
- `REPAIR_UPLOAD_LINKS` – repair pass for already-imported posts with links.  
- `LOOSEN_UPLOAD_CONSTRAINTS` – relax upload size/extension checks during import and increases file size limits and allows all extensions during the import step.
2025-10-13 21:23:34 +02:00
..
benchmarks DEV: Update rubocop-discourse to 3.6.0 (#24945) 2023-12-18 13:44:36 +01:00
bulk_import DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
demon_test
import_scripts DEV: Enhance MyLittleForum importer (#34696) 2025-10-13 21:23:34 +02:00
.gitignore
alice.txt
analyse_message_bus.rb
analyze_sidekiq_queues.rb
assemble_ember_build.rb DEV: Relax rules for JS build reuse (#34489) 2025-09-26 13:12:28 +01:00
bench.rb DEV: Fix benchmark script 2024-11-20 14:36:44 +01:00
biggest_objects.rb
boot_mem.rb
build_jsconfig.rb DEV: Update to latest @glint/ember-tsc (#35337) 2025-10-11 19:40:00 +01:00
cache_critical_dns DEV: Support connecting to Redis with a username. (#31710) 2025-03-13 10:39:50 +08:00
check_forking.rb
check_reproducible_assets.rb DEV: introduce Embroider behind a flag, and start testing in CI (#23005) 2023-09-07 13:15:43 +01:00
copyright-deposit
db_timestamps_mover.rb DEV: Remove ignored tables that have been dropped (#30185) 2024-12-10 07:11:05 +08:00
diff_heaps.rb DEV: Update to lastest rubocop-discourse 2024-05-27 18:06:14 +02:00
discourse FEATURE: Add utilities for importing and exporting backups (#32992) 2025-06-11 15:44:10 +03:00
docker_test.rb DEV: Fix typo in docker_test.rb script (#23456) 2023-09-07 15:36:27 +08:00
get_github_workflow_run_job_id.rb DEV: Fix flaky tests report artifacts not using the right job_id (#24939) 2023-12-18 15:59:41 +08:00
i18n_lint.rb DEV: update various ai agent configurations (#34192) 2025-08-11 10:08:41 +10:00
install_minio_binaries.rb Revert "DEV: Skip MinioRunner until min.io renews their cert (#25137)" (#25138) 2024-01-05 14:08:27 +08:00
list_bundled_plugins DEV: Update core lint commands to only affect bundled plugins (#29824) 2024-11-19 18:56:14 +00:00
local_minio_s3.rb DEV: Add S3 upload system specs using minio (#22975) 2023-08-23 11:18:33 +10:00
memory-analysis DEV: Fix various rubocop lints (#24749) 2023-12-06 23:25:00 +01:00
memstats.rb
micro_bench.rb
mwrap_sidekiq
profile_db_generator.rb DEV: Update rubocop-discourse to 3.13 and autofix issues (#35073) 2025-10-06 16:11:01 +02:00
promote_migrations
publish_built_assets.rb DEV: Publish and enable use of pre-built JS assets (#33973) 2025-07-31 14:22:51 +01:00
rails
redis_memory.rb
require_profiler.rb
silence_successful_output DEV: Silence successful database migration output in github actions (#24416) 2023-11-16 15:55:41 +00:00
spawn_backup_restore.rb
start_test_db.rb DEV: Set synchronous_commit to off in start_test_db (#25453) 2024-01-29 10:14:32 +08:00
switch_container_ruby
test_email_settings.rb
test_mem.rb
test_memory_leak.rb
test_pretty_text.rb
thread_detective.rb DEV: lint against Layout/EmptyLineBetweenDefs (#24914) 2023-12-15 23:46:04 +08:00
user_simulator.rb DEV: Clean up requires (#34946) 2025-09-24 12:00:22 +02:00