❓ Support
Subarist Subarist May 26, 2023

waterhole/import failed to import user data

After setting the composer.json file to "minimum-stability": "dev",
the waterhole/import was installed successfully.

But I am unable to enter user data at all. Can I check the log to provide further assistance?
The same goes for a blank database.

image.png
image.png

⁨9⁩ ⁨Comments⁩

Toby Toby Waterhole Founder May 26, 2023

Hi @Subarist,

I've just pushed a couple of fixes to user importing. Please make sure the version constraint for the waterhole/import package in composer.json is set to * or 0.1.x-dev, and then run composer update to pull in the changes, then try running the import again.

The groups error indicates your database already has some data in it. Per the docs, make sure you're running this on a fresh Waterhole installation, before the waterhole:install command has been run.

In reply to Toby Toby

In fact, I noticed that the the database is changing.
The progress bar is also increasing.
So, I have decided to let it run until completion and see what happens.
I think it will take some time.😇

image.png
image.png

After approximately 40 mins, it was completed.

Error importing comments #573211: DOMDocument::loadXML(): Opening and ending tag mismatch: t line 1 and br in Entity, line: 1

Error importing comments #573212: DOMDocument::loadXML(): EntityRef: expecting ';' in Entity, line: 1

Error importing comments #573213: DOMDocument::loadXML(): Opening and ending tag mismatch: t line 1 and br in Entity, line: 1

Error importing comments #573216: DOMDocument::loadXML(): Opening and ending tag mismatch: t line 1 and br in Entity, line: 1

Error importing comments #573217: DOMDocument::loadXML(): Opening and ending tag mismatch: t line 1 and br in Entity, line: 1

Error importing comments #573223: DOMDocument::loadXML(): Opening and ending tag mismatch: t line 1 and br in Entity, line: 1
 537738/537738 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

Comparison to the size of the data table, it appears that there are many missing entries.

flarum:
image.png

waterhole :
image.png

flarum_posts & waterhole_comment :
image.png
image.png

User data was entered, but unable to log in. Is it necessary to change the password?
image.png

Toby Toby Waterhole Founder May 27, 2023
In reply to Subarist Subarist

It looks like many of the posts in your Flarum table contain closing </br> tags, in the absence of an opening <br> tag. This is invalid XML and doesn't make sense – they should be self-closing <br/> tags.

  1. Can you please post the full content of one of these posts?
  2. Can you verify that Flarum renders these posts properly?

A possible fix may be to run a find & replace on your Flarum posts table, replacing </br> with <br/>, and then try running the import again.

User data was entered, but unable to log in. Is it necessary to change the password?

Yes, user passwords will need to be reset.

In reply to Toby Toby

My database is integrated with PHPBB and DISCUZ, and it contains many outdated or customized code syntax.
After several rounds of merging and migrating to FLARUM, there may be some issues.

Now, following the hint, I replaced "</br>" with "<br/>":
image.png

Currently, no errors are being thrown, and I think we will know in 40 minutes...
image.png

Note: The configuration and execution of the conversion process itself are actually quite simple.

In my case, the data specification of the database is quite messy, which resulted in continuous errors during the conversion (phpbb & discuz) process.
The reason is that the content of the database fails the "isValidXML" check.

image.png

I tried replacing obvious syntax errors in the database, such as "</br>" and "<br/>" as mentioned earlier.
However, dealing with these issues in over 50K articles proved to be too difficult. The variety of non-compliant code drove me crazy.
Another consideration is that after modifying the database, many older articles will lose their distinctive bbcode? features (which are still presented uniquely on Flarum).

image.png

Approximately 99.99% of the entire database consists of articles in this peculiar format, and there are very few newly generated articles after migrating to Flarum. So, I decided to try skipping the check and directly import all the data.

importDiscussionsAsPosts / importPostsAsComments
'parsed_body' => $row->content

image.png

After the import was completed, I discovered that most of the articles only had titles in their first posts, losing the main content. It was then that I realized that due to the conversion from phpbb & discuz to Flarum, there might be some differences in the formatting of the old conversion program. As a result, all my discussions were missing the "first_post_id," which is crucial for the new style of display in Waterhole. However, it appears normal in Flarum because the hero title is present, followed by the posts.

Just when I was about to give up, ChatGPT suggested that I try rebuilding the "first_post_id":

image.png

After several hours of hardship, various attempts, and encountering errors, I have achieved some results that I hope won't pose major issues. Now, I can start verifying the other functionalities.

image.png

image.png

中文測試需求< -- pointless, just to test the UTF8 search ability