Migration einer Mailingliste zu Discourse (mbox, Listserv, Google Groups usw)

This guide is for you if you want to migrate a mailing list to Discourse.
It also contains instructions for importing messages from image Google Groups.

1. Importing using Docker container

This is the recommended way for importing content from your mailing lists into Discourse.

1.1. Installing Discourse

:bulb: The import script most likely won’t work on systems with less than 4GB of RAM. Recommended are 8GB of RAM or more. You can scale back the RAM usage after the import if you like.

Install Discourse by following the official installation guide. Afterwards it’s a good idea to go to the Admin section and configure a few settings:

  • Enable login_required if imported topics shouldn’t be visible to the public

  • Enable hide_user_profiles_from_public if user profiles shouldn’t be visible to the public.

  • Disable download_remote_images_to_local if you don’t want Discourse to download images embedded in posts.

  • Enable disable_edit_notifications if you enabled download_remote_images_to_local and don’t want your users to get lots of notifications about posts edited by the system user.

  • Change the value of slug_generation_method if most of the topic titles use characters which shouldn’t be mapped to ASCII (e.g. Arabic). See this post for more information.

:bangbang: The following steps assume that you installed Discourse on Ubuntu and that you are connected to the machine via SSH or have direct access to the machine’s terminal.

1.2. Preparing the Docker container

Copy the container configuration file app.yml to import.yml and edit it with your favorite editor.

cd /var/discourse
cp containers/app.yml containers/import.yml
nano containers/import.yml
Regular import

Add - "templates/import/mbox.template.yml" to the list of templates. Afterwards it should look something like this:

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
  #- "templates/web.ssl.template.yml"
  #- "templates/web.letsencrypt.ssl.template.yml"
  - "templates/import/mbox.template.yml"

That’s it. You can save the file, close the editor and build the container.

Google Groups import

You need to add two entries to the list of templates:

  - "templates/import/chrome-dep.template.yml"
  - "templates/import/mbox.template.yml"

Afterwards it should look something like this:

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  - "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
  #- "templates/web.ssl.template.yml"
  #- "templates/web.letsencrypt.ssl.template.yml"
  - "templates/import/chrome-dep.template.yml"
  - "templates/import/mbox.template.yml"

That’s it. You can save the file, close the editor and build the container.

/var/discourse/launcher stop app
/var/discourse/launcher rebuild import

Building the container creates an import directory within the container’s shared directory. It looks like this:

/var/discourse/shared/standalone/import
├── data
└── settings.yml

1.3. Downloading messages from Google Groups (optional)

You can skip this step unless you want to migrate from image Google Groups.

Instructions for Google Groups

1.3.1. Preparation

:warning: Make sure you don’t have any pinned posts in your group, otherwise the crawler might fail to download some or all messages.

:warning: Make sure the group settings allow posting, otherwise you might see “Failed to scrape message” error messages. It might take a couple of minutes before the scraping works when you changed those settings recently.

Google account: You need a Google account that has the Manager or Owner role for your Google Group, otherwise the downloaded messages will contain censored email addresses.

Group name: You can find the group name by visiting your Google Group and looking at the browser’s address bar. image

Domain name: The URL might look a little bit differently if you are a G Suite customer. You need to know the domain name if the URL contains something like example.com. image

1.3.2 Cookies :cookie:

In order to download messages, the crawler needs to have access to a Google account that has the owner role for your group. Please visit https://myaccount.google.com/ in your browser and sign in if you aren’t already logged in. Then use a browser extension of your choice to export your cookies for google.com in a file named cookies.txt.

The recommended browser extensions is Export Cookies for Mozilla Firefox.

Upload the cookies.txt file to your server and save it within the /var/discourse/shared/standalone/import directory.

1.3.3. Download messages

:bulb: Tip: It’s a good idea to download messages inside a tmux or screen session, so that you can reconnect to the session in case of SSH connection loss.

Let’s start by entering the Docker container.

/var/discourse/launcher enter import

Replace the <group_name> (and if applicable, the <domain_name>) placeholders within the following command with the group name and domain name from step 1.3.1 and execute it inside the Docker container in order to start the download of messages.

If you didn’t find a domain name in step 1.3.1, this is the command for you:

script/import_scripts/google_groups.rb -g <group_name>

Or, if you found a domain name in step 1.3.1, use this command instead:

script/import_scripts/google_groups.rb -g <group_name> -d <domain_name>

Downloading all messages can take a long time. It mostly depends on the number of topics in your Google Group. The script will show you a message like this when it’s finished: Done (00h 26min 52sec)

:bulb: Tip: You can abort the download anytime you want by pressing Ctrl+C
When you restart the download it will continue where it left off.

1.4. Configuring the importer

You can configure the importer by editing the example settings.yml file that has been copied into the import directory.

nano /var/discourse/shared/standalone/import/settings.yml

The settings file comes with sensible defaults, but here are a few tips anyway:

  • The settings file contains multiple examples on how to split data files:

    • mbox files usually are separated by a From header. Choose a regular expression that works for your files.

    • If each of your files contains only one message, set the split_regex to an empty string. This also applies to imports from image Google Groups.

    • There’s also an example for files from the popular Listserv mailing list software.

  • prefer_html allows you to configure if the import should use the HTML part of emails when it exists. You should choose what suits you best – it heavily depends on the emails sent to your mailing list.

  • By default each user imported from the mailing list is created as staged user. You can disable that behaviour by setting staged to false.

  • If your emails do not contain a Message-ID header (like messages stored by Listserv), you should enable the group_messages_by_subject setting.

1.5. Prepare files

Each subdirectory of /var/discourse/shared/standalone/import/data gets imported as its own category and each directory should contain the data files you want to import. The file names of those do not matter.

Example: The import directory should look like this if you want to import two mailing lists with multiple mbox files:

/var/discourse/shared/standalone/import
├── data
│   ├── list 1
│   │   ├── foo
│   │   ├── bar
│   ├── list 2
│   │   ├── 2017-12.mbox
│   │   ├── 2018-01.mbox
└── settings.yml

1.6. Executing the import script

:bulb: Tip: It’s a good idea to start the import inside a tmux or screen session, so that you can reconnect to the session in case of SSH connection loss.

Let’s start the import by entering the Docker container and launching the import script inside the Docker container.

/var/discourse/launcher enter import
import_mbox.sh # inside the Docker container

Depending on the size of your mailing lists it’s now time for some :coffee: or :sleeping:
The import script will show you a message like this when it’s finished: Done (00h 26min 52sec)

:bulb: Tip: You can abort the import anytime you want by pressing Ctrl+C
When you restart the import it will continue where it left off.

You can exit and stop the Docker container after the import has finished.

exit # inside the Docker container
/var/discourse/launcher stop import

1.7. Starting Discourse

Let’s start the app container and take a look at the imported data.

/var/discourse/launcher start app

Discourse will start and Sidekiq will begin post-processing all the imported posts. This can take a considerate amount of time. You can watch the progress by logging in as admin and visiting http://discourse.example.com/sidekiq

1.8. Clean up

So, you are satisfied with the result of the import and want to free some disk space? The following commands will delete the Docker container used for importing as well as all the files used during the import.

/var/discourse/launcher destroy import
rm /var/discourse/containers/import.yml
rm -R /var/discourse/shared/standalone/import

1.9. The End

Now it’s time to celebrate and enjoy your new Discourse instance! :tada:

2. FAQ

2.1. How can I remove list names (e.g. [Foo]) from topic titles during the import?

You can use an empty tag to remove one or more prefixes from topic titles. The settings file contains an example.

2.2 How can I prevent the import script from detecting messages as already being imported?

:warning: The following steps will reset your Discourse forum to the initial state! You will need to start from scratch.

The following commands will stop the container, delete everything except the mbox files and the importer configuration and restart the container.

Commands
cd /var/discourse

./launcher stop app
./launcher stop import

rm -r ./shared/standalone/!(import)
rm ./shared/standalone/import/data/index.db

./launcher rebuild import

./launcher enter import
import_mbox.sh # inside the Docker container

2.3 How can I manipulate messages before they are imported into Discourse?

Enable index_only in settings.yml and take a look at the index.db (a SQLite database) before you run the actual import.

You can use SQL to update missing values in the database if you want. That way you don’t need to reindex any messages. The script uses only data from the index.db during the import phase. Simply disable the index_only option when you are done and rerun the importer. It will skip the indexing if none of the mbox files were changed, recalculate the content of the user and email_order tables and start the actual import process.

2.4 How can I find messages which cause problems during the import?

You can split mbox files into individual files to make it easier to find offending emails.

Commands
apt install procmail;
export FILENO=0000;
formail -ds sh -c 'cat &gt; split/msg.$FILENO' < mbox;

2.5 I have already imported a group. How can I import another group?

Create a new directory in the import/data directory and restart the import script.

2.6 I don’t have access to Mailman archives in mbox format? Is there any other way to get them?

You could give this script a try.

Last edited by @JammyDodger 2024-05-27T14:56:11Z

Check documentPerform check on document:
30 „Gefällt mir“

@gerhard - I was able to migrate an mbox archive of 22,000 messages using this script on a Digital Ocean droplet with only 1GB RAM. No problems. Thank you for the write-up of instructions. Everything worked great. The only mistake I made on my first attempt was trying to name the /var/discourse/shared/standalone/import/data/X subfolder using a new category I created before running the script. That caused the import to place these messages into the Uncategorized category. On second attempt, I deleted the new category and tried again. This created the category name for me and placed the messages into the proper category automatically.

6 „Gefällt mir“

Thanks for this guide.

I’m attempting to do a Google Groups import. Unfortunately, I run into this error when running import_mbox.sh:

The mbox import is starting...

Traceback (most recent call last):
5: from script/import_scripts/mbox.rb:9:in `<main>'
4: from script/import_scripts/mbox.rb:10:in `<module:ImportScripts>'
3: from script/import_scripts/mbox.rb:13:in `<module:Mbox>'
2: from /var/www/discourse/script/import_scripts/mbox/support/settings.rb:9:in `load'
1: from /var/www/discourse/script/import_scripts/mbox/support/settings.rb:9:in `new'

/var/www/discourse/script/import_scripts/mbox/support/settings.rb:42:in `initialize': undefined method `each' for nil:NilClass (NoMethodError)

All files in /var/discourse/shared/standalone/import/data/Foo are .eml files though, not mbox. Does that matter?

Thanks!

The latest version of the import script fixes that problem. As an alternative, please update your settings file. There were some recent changes.

5 „Gefällt mir“

Thanks a lot. Could you please give some advice on how to update the import script?

Is it enough to just update the import scripts or do I have to redo more steps of the guide (which ones?)? I can’t find them and therefore don’t know how to update them.

I did update the settings file as you mentioned this being an alternative, but I’m getting the same issues.

Thanks.

You can run /var/discourse/launcher rebuild import to update the import script and everything else related to it.

4 „Gefällt mir“

Thanks.

While running import_mbox.sh almost all messages are skipped with messages like the following:

script/import_scripts/mbox.rb:12:in `<module:Mbox>'

script/import_scripts/mbox.rb:10:in `<module:ImportScripts>'

script/import_scripts/mbox.rb:9:in `<main>'

41 / 215 ( 19.1%) [59096 items/min] Failed to map post for 36a37072-e5b6-4009-878f-f0824e40eac6@googlegroups.com

undefined method `each' for nil:NilClass

/var/www/discourse/script/import_scripts/mbox/importer.rb:179:in `block in remove_tags!'

/var/www/discourse/script/import_scripts/mbox/importer.rb:176:in `loop'

/var/www/discourse/script/import_scripts/mbox/importer.rb:176:in `remove_tags!'

/var/www/discourse/script/import_scripts/mbox/importer.rb:150:in `map_first_post'

/var/www/discourse/script/import_scripts/mbox/importer.rb:104:in `block (2 levels) in import_posts'

/var/www/discourse/script/import_scripts/base.rb:503:in `block in create_posts'

/var/www/discourse/script/import_scripts/base.rb:502:in `each'

/var/www/discourse/script/import_scripts/base.rb:502:in `create_posts'

/var/www/discourse/script/import_scripts/mbox/importer.rb:98:in `block in import_posts'

/var/www/discourse/script/import_scripts/base.rb:882:in `block in batches'

/var/www/discourse/script/import_scripts/base.rb:881:in `loop'

/var/www/discourse/script/import_scripts/base.rb:881:in `batches'

/var/www/discourse/script/import_scripts/mbox/importer.rb:84:in `batches'

/var/www/discourse/script/import_scripts/mbox/importer.rb:92:in `import_posts'

/var/www/discourse/script/import_scripts/mbox/importer.rb:36:in `execute'

/var/www/discourse/script/import_scripts/base.rb:47:in `perform'

And further down:

60 / 215 ( 27.9%) [58321 items/min] Parent message 1b46f337-95a3-4b4a-a14a-689636941580@googlegroups.com doesn't exist. Skipping 5634208e-e6df-4bd8-b361-0735f73fe554@googlegroups.com:

What could be the reason for this? Thanks.

The problem should be fixed. Please rebuild your import container one more time.

6 „Gefällt mir“

Sweet, it worked like a charm. :pray: Thanks so much for your support.

5 „Gefällt mir“

I’m trying to download Google Groups and am getting

Failed to login. Please check the content of your cookies.txt

I used the recommended Firefox extension to download the cookies. Once yesterday and again today. I’ve confirmed that it’s reading the file by renaming it to something wrong and getting a “not found” error. I downloaded all the cookies, not just google ones. I logged out and back in and downloaded the cookies again.

I can see that I’m a manager because I have the “manage group” options.

I’ve triple-rechecked that I’m using the right group name by copy-pasting and seeing that it’s a group name format and not a domain name one.

Is something broken or is it just me?

@gerhard, sorry for the call-out, but have you a quick suggestion on how to debug this? Maybe a login endpoint has changed?

EDIT: Found it. I’ll submit a PR shortly. The endpoint for login changed and I managed to guess the new one. :slight_smile:

1 „Gefällt mir“

Newbie trying to import mbox files from Yahoo groups. I’ve followed these instructions several times but always with the same error message. I see others have been successful so it is likely a newbie mistake. The error appears to indicate that split_regex: "^From .+@.+" is not finding the email key to split the file but I tested the regex in a text editor and it works as expected. Line 2 of the import file is similar to Message-ID: <35690.0.1.959300741@eGroups.com>
Any ideas? TIA…

The mbox import is starting...

Traceback (most recent call last):
	12: from script/import_scripts/mbox.rb:9:in `<main>'
	11: from script/import_scripts/mbox.rb:10:in `<module:ImportScripts>'
	10: from script/import_scripts/mbox.rb:12:in `<module:Mbox>'
	 9: from script/import_scripts/mbox.rb:12:in `new'
	 8: from /var/www/discourse/script/import_scripts/mbox/importer.rb:11:in `initialize'
	 7: from /var/www/discourse/script/import_scripts/mbox/support/settings.rb:8:in `load'
	 6: from /usr/local/lib/ruby/2.6.0/psych.rb:577:in `load_file'
	 5: from /usr/local/lib/ruby/2.6.0/psych.rb:577:in `open'
	 4: from /usr/local/lib/ruby/2.6.0/psych.rb:578:in `block in load_file'
	 3: from /usr/local/lib/ruby/2.6.0/psych.rb:277:in `load'
	 2: from /usr/local/lib/ruby/2.6.0/psych.rb:390:in `parse'
	 1: from /usr/local/lib/ruby/2.6.0/psych.rb:456:in `parse_stream'
/usr/local/lib/ruby/2.6.0/psych.rb:456:in `parse': (/shared/import/settings.yml): did not find expected key while parsing a block mapping at line 2 column 1 (Psych::SyntaxError)

Looks like you made an error in the settings.yml file. I suggest you validate the configuration at http://www.yamllint.com/

3 „Gefällt mir“

Thanks @gerhard Sigh…I should have seen that issue, my first bout with Ruby. Now, I think I’m a little closer but a different error (see below). Since the import script is now loading Groups, etc., I assume the new error is past the initial problem. I also assume the referenced db file is import/index.db created by the import script (not created).

The mbox import is starting...

Loading existing groups...
Loading existing users...
Loading existing categories...
Loading existing posts...
Loading existing topics...
Traceback (most recent call last):
	9: from script/import_scripts/mbox.rb:9:in `<main>'
	8: from script/import_scripts/mbox.rb:10:in `<module:ImportScripts>'
	7: from script/import_scripts/mbox.rb:12:in `<module:Mbox>'
	6: from script/import_scripts/mbox.rb:12:in `new'
	5: from /var/www/discourse/script/import_scripts/mbox/importer.rb:14:in `initialize'
	4: from /var/www/discourse/script/import_scripts/mbox/importer.rb:14:in `new'
	3: from /var/www/discourse/script/import_scripts/mbox/support/database.rb:10:in `initialize'
	2: from /var/www/discourse/script/import_scripts/mbox/support/database.rb:10:in `new'
	1: from /var/www/discourse/vendor/bundle/ruby/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3/database.rb:89:in `initialize'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3/database.rb:89:in `open_v2': unable to open database file (SQLite3::CantOpenException)
1 „Gefällt mir“

SYSTEM won’t allow me to edit my comment so I am submitting this reply instead.

EDIT: To close the loop…My Yahoo Group import is now working, at least to the point of indexing 9951 emails. I have not yet finished the full import so more to come. I have edited settings.yml many times and am now back to the original which suddenly seems to work! without the syntax error. I don’t understand why I have had numerous error messages that appear inconsistent to me. The original syntax error in the settings.yml is again a mystery. The above error mag makes no sense to me…sigh.

1 „Gefällt mir“

@gerhard. Ich glaube, ich habe eine deutlich einfachere Methode gefunden, genau dasselbe zu erreichen wie in deinem Leitfaden, jedoch ohne technische Vorkenntnisse und ohne Administratorrechte auf einem Server. Lass mich wissen, was du davon hältst.

Überblick

Wir konfigurieren im Wesentlichen eine Mailingliste und nutzen dann ein E-Mail-Archiv, um vergangene Gespräche der Reihe nach zu versenden. Diese E-Mails werden weitergeleitet, aber nicht wie über die „Weiterleiten“-Schaltfläche in E-Mail-Clients (dies würde die Header überschreiben und die Einrückung durcheinanderbringen). Was wir tun möchten, ist, sie erneut zu versenden (so, als wären sie ursprünglich an Discourse gesendet worden).

Voraussetzungen und Annahmen

  • Zugriff auf die vorherigen E-Mail-Austausche: Jemand, der alles in seinem E-Mail-Client gespeichert hat und bereit ist, weiterzuleiten – nennen wir diese Person John Doe.

  • Zeit: Das Weiterleiten der E-Mails wird sehr langsam sein, damit Discourse damit zurechtkommt (vielleicht ein paar Tage, wobei ein Computer läuft und die E-Mails hochlädt – abhängig von der Größe des Archivs).

  • Thunderbird-Client: Wir gehen hier davon aus, dass John Doe den E-Mail-Client „Thunderbird“ verwendet. Es könnte möglich sein, dies mit anderen Clients zu tun, aber ich habe das nicht untersucht.

Der folgende Leitfaden verwendet zwei E-Mail-Adressen als Platzhalter. Du musst sie durch deine tatsächlichen Adressen ersetzen.

:incoming_envelope: johndoe@example.com John Does E-Mail (die Person wird das gesamte Mailinglisten-Archiv weiterleiten)

:postbox: discourse+mailinglist-3@discoursemail.com Discourse-E-Mail zum Weiterleiten von E-Mails in die Kategorie der Mailingliste (siehe Einrichtung 1., wie du diese erhältst)

Anweisungen

Hier ist eine grundlegende Übersicht der Anweisungen:

  1. Folge dem Leitfaden unter Mirroring a read-only mailing list in Discourse, um einen Spiegel deiner Mailingliste zu erstellen.

    Hinweis: Dies spiegelt nur deine Mailingliste ab diesem Zeitpunkt wider. Du wirst die vergangenen Gespräche immer noch verpassen. Dafür dient der Rest dieses Leitfadens.

  2. Ändere die Art und Weise, wie Discourse E-Mails weiterleitet (ich bin mir nicht sicher, ob dies wirklich nötig ist)
    forwarded_behavior

  3. Bearbeite die Einstellungen der Kategorie und füge unter der Einstellung Benutzerdefinierte eingehende E-Mail-Adresse: am Ende des Vorhandenen |johndoe@example.com hinzu.

    Das Pipe-Zeichen hier funktioniert wie ein ,, das heißt, du möchtest auch, dass johndoe@example.com an diese Kategorie senden kann

  4. John Doe installiert in Thunderbird die Erweiterung Mail Redirect.

    Das liegt daran, dass es sich nicht um eine reguläre E-Mail-Weiterleitung handelt. Dies wird die E-Mail so senden, als wäre sie ursprünglich an die Discourse-E-Mail-Adresse gesendet worden, und nicht an John Doe.

  5. John Doe geht in die Einstellungen der Erweiterung und setzt den folgenden Wert auf 1 (Standard ist 5).
    mail_redirect

    Dies stellt sicher, dass die Antworten in der richtigen Reihenfolge eintreffen: Andernfalls merkt Discourse nicht schnell genug, dass die Antworten verkettet sind, und erstellt für jede Antwort ein neues Thema – dies wird den Weiterleitungsprozess jedoch sehr langsam machen.

  6. John Doe wählt alle vergangenen E-Mails der Mailingliste aus, klickt mit der rechten Maustaste und wählt Umleiten. Dann öffnet sich ein neues Fenster, und er fügt discourse+mailinglist-3@discoursemail.com als Erneut senden an hinzu.

Danach wird John Does E-Mail-Client langsam die E-Mail-Archive an Discourse senden. Überprüfe einfach nach einiger Zeit, ob die Discourse-Kategorie mit nostalgisch alten Gesprächen gefüllt wird.

Bereinigung

  • Entferne John Does E-Mail aus der Einstellung Benutzerdefinierte eingehende E-Mail-Adresse: dieser Kategorie (und vergiss nicht, das | zu entfernen).

  • Deinstalliere die Erweiterung Mail Redirect – du wirst sie wahrscheinlich nicht wieder benötigen, oder zumindest die SMTP-Verbindungen wieder auf 5 erhöhen.

5 „Gefällt mir“

Wir versuchen, unsere Mailman-Listen in eine bereits laufende Discourse-Instanz zu migrieren. Es sind mehrere private Listen enthalten, für die wir Berechtigungen für die entsprechende Kategorie festlegen müssen. Wenn wir diese Kategorien vor dem Import erstellen, werden alle Beiträge der privaten Listen automatisch der Kategorie „Uncategorized

3 „Gefällt mir“

Mein Discourse ist die Fortsetzung einer Yahoo-Gruppe, die selbst wiederum eine Fortsetzung eines AOL-Listservs war. Im letzten Herbst, angesichts der großen Yahoo-Bereinigung, konnte ich ein .mbox-Archiv der Yahoo-Gruppe herunterladen und diese Nachrichten gemäß diesen Anweisungen importieren. Jetzt habe ich ein teilweises Archiv des AOL-Listservs erhalten und möchte diese Nachrichten ebenfalls importieren.

Das sollte doch einfach sein, oder? Einfach import/data/foo erstellen, die Nachrichten dort ablegen und das Import-Skript ausführen. Aber ich frage mich, was passiert, wenn ich später ein vollständiges (oder ein vollständigeres) Archiv bekomme. Kann ich diese Dateien dann einfach in import/data/foo legen, das Import-Skript erneut ausführen und die neuen Nachrichten zur selben Kategorie hinzufügen lassen?

  • Wird dabei eine Duplikatentfernung durchgeführt? Oder werde ich mehrere Kopien von Nachrichten sehen, die in beiden Archiven enthalten waren?
    • Ändert sich die Antwort auf diese Frage, wenn eines, das andere oder beide Archive keine Message-ID-Header enthalten?
  • Wird ein neuer Import in derselben Kategorie vorhandene Nachrichten überschreiben?
  • Die meisten meiner Benutzer befinden sich im Mailing-Listen-Modus. Wenn ich nicht möchte, dass sie mit Hunderten (oder Tausenden) von Benachrichtigungen bombardiert werden, geschweige denn eine teure Mailgun-Rechnung erhalten, nehme ich an, dass ich die E-Mail-Funktion auf der gesamten Seite deaktivieren sollte, während der Import läuft?
3 „Gefällt mir“

Leider ist das nicht möglich.

Ja, du kannst das Importskript dazu bringen, bestehende Kategorien wiederzuverwenden.

./launcher enter app
rails c

# Verwende die in der URL angezeigte Kategorie-ID, zum Beispiel
# ist es 56, wenn der Pfad der Kategorie so aussieht: /c/howto/devs/56
category = Category.find(56)

# Verwende den Verzeichnisnamen, in dem die mbox-Dateien gespeichert sind. Zum Beispiel,
# wenn die Dateien in import/data/foo gespeichert sind, solltest du "foo" als Verzeichnisnamen verwenden.
category.custom_fields["import_id"] = "Verzeichnisname"
category.save!

Das ist unerwartet. Ich habe das noch nie gesehen, aber ich habe auch nie versucht, in bestehende Kategorien mit Berechtigungen zu importieren, die von den Standardberechtigungen abweichen.

Wenn du es nicht zum Laufen bekommst, würde ich vorschlagen, eine Ankündigung auf deinem Forum zu veröffentlichen, deine Seite in den Nur-Lese-Modus zu versetzen, ein Backup zu erstellen, das Backup auf einem anderen Server wiederherzustellen, den Import durchzuführen, die Kategorienberechtigungen zu konfigurieren, ein weiteres Backup zu erstellen und es auf deiner Produktionsseite wiederherzustellen.

3 „Gefällt mir“

Ja, das können Sie. Es könnte sinnvoll sein, die Datei import/data/index.db vorübergehend aufzubewahren, falls Sie später auf zuvor importierte Daten zugreifen oder generierte Nachrichten-IDs ändern müssen usw.

Ja, bereits importierte Nachrichten werden nicht erneut importiert, solange der Message-ID-Header unverändert bleibt. Wenn der Message-ID-Header jedoch nur in einem der Archive fehlt, haben Sie Pech. In diesem Fall verwenden wir den MD5-Hash der Nachricht. Sie müssen sicherstellen, dass beide Nachrichten entweder denselben Message-ID-Header haben oder denselben MD5-Hash ergeben.

Nein.

Alle ausgehenden E-Mails sind während Importen deaktiviert.

3 „Gefällt mir“

Ja, man kann das Import-Skript dazu bringen, bestehende Kategorien wiederzuverwenden.

Okay, das haben wir am Ende im Wesentlichen auch gemacht (wir haben stattdessen Category.find_by_name() verwendet, aber das ist wohl nur Semantik). Gut zu wissen, dass wir den „richtigen

3 „Gefällt mir“