and I ran ./launcher rebuild app after the import. The import seems to have worked entirely, except that I cannot log in with my password from phpbb. There werenât any relevant error messages that I spotted from the import, and the password is 20 characters long, so should clear the minimum length limit.
What should I be looking for to troubleshoot this?
A bit more information: I see import_pass entries in the user_custom_fields table of the database that match password hashes that were in the phpbb database, so that part seems to have worked?
Edit: Oh ho, I figured out what happened. I had completely forgotten that we had switched to LDAP authentication for phpbb⌠The passwords I imported were totally fine, just 15 years old! So now I need to knock something together to extract the password hashes from LDAP insteadâŚ
First, I though it was because the 3.0.12 phpbbâs version was too old but I upgraded phpBB to 3.0.14, cleaned Discourse and uploads folder, and tried the import again. No luck.
I upgraded the phpbb version to 3.2.0 (after running their support toolkit to clean the database of the mods) on a test server, still no luck.
Before investigating further on my database, I wanted to be sure that the script works for everyone
I donât think Iâve made a mistake on my settings file, but maybe a fresh look on this might help
# This is an example settings file for the phpBB3 importer.
database:
type: MySQL # currently only MySQL is supported
host: localhost
port: 3306
username: root
password:
schema: phpbb
table_prefix: phpbb_ # Change this, if your forum is using a different prefix. Usually all table names start with phpbb_
batch_size: 1000 # Don't change this unless you know what you're doing. The default (1000) should work just fine.
import:
# Set this if you import multiple phpBB forums into a single Discourse forum.
#
# For example, when importing multiple sites, prefix all imported IDs
# with 'first' to avoid conflicts. Subsequent import runs must have a
# different 'site_name'.
#
# site_name: first
#
site_name:
# Create new categories
#
# For example, to create a parent category and a subcategory.
#
# new_categories:
# - forum_id: foo
# name: Foo Category
# - forum_id: bar
# name: Bar Category
# parent_id: foo
#
new_categories: []
# Category mappings
#
# For example, topics from phpBB category 1 and 2 will be imported
# in the new "Foo Category" category, topics from phpBB category 3
# will be imported in subcategory "Bar category", topics from phpBB
# category 4 will be merged into category 5 and category 6 will be
# skipped.
#
# category_mappings:
# 1: foo
# 2: foo
# 3: bar
# 4: 5
# 6: SKIP
#
category_mappings: {}
# Tag mappings
#
# For example, imported topics from phpBB category 1 will be tagged
# with 'first-category', etc.
#
# tag_mappings:
# 1:
# - first-category
# 2:
# - second-category
# 3:
# - third-category
#
tag_mappings:
# Rank to trust level mapping
#
# Map phpBB 3.x rank levels to trust level
# Users with rank at least 3000 will have TL3, etc.
#
# rank_mapping:
# trust_level_1: 200
# trust_level_2: 1000
# trust_level_3: 3000
#
rank_mapping:
# WARNING: Do not activate this option unless you know what you are doing.
# It will probably break the BBCode to Markdown conversion and slows down your import.
use_bbcode_to_md: false
# This is the path to the root directory of your current phpBB installation (or a copy of it).
# The importer expects to find the /files and /images directories within the base directory.
# You need to change this to something like /var/www/phpbb if you are not using the Docker based importer.
# This is only needed if you want to import avatars, attachments or custom smilies.
phpbb_base_dir: /shared/import/data
site_prefix:
# this is needed for rewriting internal links in posts
original: ***.com # without http(s)://
new: https://****.org # with http:// or https://
# Enable this, if you want to redirect old forum links to the the new locations.
permalinks:
categories: true # redirects /viewforum.php?f=1 to /c/category-name
topics: true # redirects /viewtopic.php?f=6&t=43 to /t/topic-name/81
posts: false # redirects /viewtopic.php?p=2455#p2455 to /t/topic-name/81/4
# Append a prefix to each type of link, e.g. 'forum' to redirect /forum/viewtopic.php?f=6&t=43 to /t/topic-name/81
# Leave it empty if your forum wasn't installed in a subfolder.
prefix:
avatars:
uploaded: true # import uploaded avatars
gallery: false # import the predefined avatars phpBB offers
remote: false # WARNING: This can considerably slow down your import. It will try to download remote avatars.
# When true: Anonymous users are imported as suspended users. They can't login and have no email address.
# When false: The system user will be used for all anonymous users.
anonymous_users: true
# Enable this, if you want import password hashes in order to use the "migratepassword" plugin.
# This will allow users to login with their current password.
# The plugin is available at: https://github.com/discoursehosting/discourse-migratepassword
passwords: false
# By default all the following things get imported. You can disable them by setting them to false.
bookmarks: true
attachments: true
private_messages: false
polls: false
# When true: each imported user will have the original username from phpBB as its name
# When false: the name of each imported user will be blank unless the username was changed during import
username_as_name: false
# Map Emojis to smilies used in phpBB. Most of the default smilies already have a mapping, but you can override
# the mappings here, if you don't like some of them.
# The mapping syntax is: emoji_name: 'smiley_in_phpbb'
# Or map multiple smilies to one Emoji: emoji_name: ['smiley1', 'smiley2']
emojis:
# here are two example mappings...
smiley: [':D', ':-D', ':grin:']
heart: ':love:'
I presume this applies to phpBB too, as Iâm trying to import dumps ranging from v3.2.x to v3.3.3 but missing parent posts are in the thousands. Even with multiple runs and multiple sequential version backups. For debug simplicity the script could output the url for the message ID to the old forum for reference checking. (⌠viewtopic.php?p=57912)
Actually since weâre at this, why not log all failed import rows with their error messages in a dump file to share for analysis⌠just a thoughtâŚ
At least one occasion is where there is a topic viewtopic.php?f=3&t=1472 but the first post viewtopic.php?p=145185 has been deleted/removed/etc and now the first post for the topic is viewtopic.php?p=145186 which is âa replyâ
Maybe for clarity actually state whether the parent topic is literally not found in the dump or just havenât been imported to the reconstruction.
Yes I double checked the folders and the settings file, the weird thing is that they are getting imported in the default/original folders, but not integrated in the posts.
It was a really old phpbb, with some plugins. I did a little cleanup and successfully upgraded from phpbb 3.0.12 to the latest 3.1 or 3.2, tested an import for each version, but it didnât work. It may be an issue with the database. Thatâs why, if you manage to succeed in a full import next time, that would be helpful to hear from you. If itâs the database from phpbb, Iâll do some heavy digging with some help, if itâs the script, I can wait. Thanks for your message!
I donât remember the last time I did a phpBB3 import, I suspect (but have no way of knowing) because the script works so well.
Since they are getting uploaded to discourse the issue is likely how they are referred to in the posts in phpbb. Do you see any errors when it runs? They could offer hints. Or maybe the plugins changed how they are in the posts and /or database. Youâll probably have to do some digging.
I had a few âmissing filesâ, âbad post timeâ, I had these during my previous imports so I donât think itâs a big issue. I also have a lot of âParent post doesnât existâ on the first run, but it was mentionned earlier in this thread, and a second run of the script fix this.
Other than that, the script ran pretty good, without any major issue.
There was a plugin (mostly a htaccess file apparently, I didnât run this forum) to arrange the files in subfolders (per months and year), but I organized it on the same folder and the upgrades on a clean version of phpbb worked fine. All the imported files were active on a phpbb 3.1, 3.2.
Iâll dig a little bit deeper on the database, I might have a sql file from an old import. Iâll compare the attachments and posts tables on my test server. Maybe thereâs a thing I missed.
Youâre correct, there has been a bug in TextProcessor::process_attachments that causes attachments to not get embedded in the post Markdown. Iâve filed a PR.
Hi, I just imported about 35k posts; during import I noticed a lot of âParent post XXXXXX doesnât exist. Skippingâ, and when process ended, in the Discourse forum I had all (I think) the âtopicsâ, but with no answer at all. Practically, it imported just the topic, not the posts (except for the first one with the text of the topic itself).
Also, no avatar was imported, event though I put them in the correct tree under âimportâ folder.
The original forum was in phpBB2, regularly imported and visible with all its posts in phpBB3, but I deleted many old messages previously; however, all seems ok in phpBB3.
Any suggestion? Is there some import script I can check?
Ho letto lâargomento piĂš volte e ho effettuato alcune migrazioni, ma ogni volta sono stato confuso da questo plugin e ho riscontrato bug simili. Sono alla mia terza migrazione e mi ha fatto impazzire. Penso che il funzionamento di questo plugin possa confondere gli utenti che effettuano migrazioni.
Dovrebbe essere specificato da qualche parte che il plugin deve essere attivato su Discourse dopo il processo di migrazione. Se è già scritto da qualche parte, potrei essermelo perso e forse questa informazione dovrebbe essere enfatizzata.
Si noti come lâinizio della regex non presupponga la presenza di un carattere : dopo:
<!-- s
Ma lo presuppone alla fine della regex:
<!-- s?:\S+ -->
(Inoltre mi chiedo perchĂŠ ci sia un ? che corrisponde a 0 o 1 del carattere s alla fine della regex, dove non câè allâinizio della regex)
Ho rimosso questo : dalla regex e i miei due problemi con le faccine sembrano completamente risolti.
Sul mio forum phpbb, molte faccine iniziavano effettivamente con : come :mrgreen: o :evil:, ma alcune no, come 8-) o ;)
La vecchia regex portava a catture errate delle faccine. Ad esempio, piĂš faccine una accanto allâaltra venivano catturate come una singola.
Non sto correggendo il codice direttamente nel repository Discourse perchĂŠ non ho familiaritĂ con lâuso di git, e inoltre non sono sicuro che influenzi le importazioni da altre versioni di phpBB. Non voglio rovinare nulla.
Comunque, se qualcuno riscontra gli stessi problemi miei, ecco la soluzione.
Un altro problema risolto che potrebbe aiutare le persone nel mio caso durante una migrazione di phpBB 3.0.7.
Per qualche motivo, i contenuti dei post del mio forum phpBB a volte avevano piĂš spazi vuoti allâinizio delle righe. Sospetto che alcuni utenti âamanoâ premere freneticamente il tasto spazio senza prestare attenzione quando scrivono il loro messaggio, e non aveva importanza poichĂŠ la pagina renderizzata ignorava questi spazi multipli:
Contenuto testuale phpBB grezzo:
Salut tous :)
Alors voilĂ , le combi n'a pas roulĂŠ beaucoup ces derniers temps cause CT pas OK :evil: mais il a fait ces 2000 kms sans broncher ;)
Maintenant le CT est OK . Merci L'Atelier Du Raz 8-')
Je dois donc changer le joint-spi au bout de 40 000 kms en 10 ans :roll:
C'est un silicone et j'ai vu qu'il y avait des "doubles lèvres " !?
What's About ?
Je trouve ça un peu limte :evil:
Merci tous, fred
Lâho risolto aggiungendo una regex che rimuove gli spazi allâinizio di ogni riga
text.gsub!(/^[^\\S\\r\\n]+/, "\\n")
Ho aggiunto questo appena prima di process_smilies(text) in questo file:
Un altro problema che ho riscontrato.
In questo codice (ancora in text_processor.rb):
def clean_bbcodes(text)
# Molti tag bbcode di phpbb hanno un hash allegato. Esempi:
# [url=https://google.com:1qh1i7ky]clicca qui[/url:1qh1i7ky]
# [quote="cybereality":b0wtlzex]Testo.[/quote:b0wtlzex]
text.gsub!(/:(?:\\w{8})\\]/, ']')
Nel mio database, le lunghezze di questi hash variano tra 5 e 8 caratteri, ma la regex rimuove solo gli hash che sono esattamente di 8 caratteri. Quindi, la mia importazione ha mantenuto hash piĂš corti invece di rimuoverli.
Ho risolto cambiando la regex in:
text.gsub!(/:(?:\\w{5,8})\\]/, ']')
Aggiungo un problema minore, sempre nello stesso file. La regex che rimuove i tag BBCode [color] si aspetta un valore esadecimale preceduto da un # obbligatorio. Ma [color] accetta anche stringhe come âredâ, âblueâ, ecc. come valore. Quindi ho modificato la regex originale:
# rimuove i tag colore
text.gsub!(/\\[\\/?color(=#[a-z0-9]*)?\\]/i, "")
Aggiungendo un ? dopo il # per rendere il # opzionale.
Codice corretto:
# rimuove i tag colore
text.gsub!(/\\[\\/?color(=#?[a-z0-9]*)?\\]/i, "")
Non so se i miei problemi siano comuni nelle importazioni phpBB, o se siano molto specifici del mio caso. Se questâultimo, spero che le mie spiegazioni qui non siano indesiderate o superflue. Fammi sapere se è cosĂŹ in modo che non sia imbarazzante.
Modifica: Ă possibile fare in modo che dopo una migrazione, tutti gli argomenti esistenti siano impostati come âlettiâ per ogni utente esistente?
Lâobiettivo è evitare che, dopo la migrazione, gli utenti esistenti che cliccano su argomenti esistenti (e talvolta vecchi) vengano reindirizzati al primo messaggio di quegli argomenti che avevano giĂ letto prima della migrazione.
Idealmente, gli utenti esistenti che cliccano su argomenti esistenti dovrebbero aprire non il primo, ma lâultimo messaggio (dalla fine della migrazione, ovviamente).
à comunque un piccolo problema di qualità della vita (e svanirà naturalmente dopo qualche settimana man mano che gli utenti utilizzano il forum e leggono gli argomenti), ma mi è stata posta questa domanda.