XF 2.2 post migration link problem

htsumer

Active member
I moved the forum. This is how the links come out after moving

1630602408516.webp

when i edit and delete the URL tags and save, it gets fixed

1630602484901.webp

1630602514616.webp

how can i refresh the whole forum
 
To update URLs in posts, you can use the post replace add-on, or if all of the URLs have a common string, you can run a simple query:
SQL:
UPDATE xf_post SET message = REPLACE(message, 'original_content', 'new_content');

Ensure you make any changes to a test installation first, before trying it on your live site.
 
You need to replace original_content and new_content in the query as required.

For example, if you moved the forum from /community to /forums, you would use:
SQL:
UPDATE xf_post SET message = REPLACE(message, 'https://example.com/community', 'https://example.com/forums');
 
You need to replace original_content and new_content in the query as required.

For example, if you moved the forum from /community to /forums, you would use:
SQL:
'UPDATE xf_post SET message = REPLACE(message, 'https://example.com/community', 'https://example.com/forums');
I moved from x domain to y domain
 
There is no problem with the links in the content, I changed all of them from the database. The links are currently not old links of your own site. Do I need to run the query in this case too? My point is that the links look plain. I want it like this

1630602514616-png.256916
 
I'm still not clear on what the actual issue is.

When you post a URL for your own site, does it fail to unfurl even though unfurl="true" is present in the bb code?

If so, that's likely going to be a server config issue.
 
these links should fix with time as xenforo would clear cache periodically. though i have noticed a weird behavior with links on my board as well. this makes me believe that these links might not get fixed automatically with time because of some unusual behavior with xenforo.

for instance i create a link like this:

https://xenforo.com/community/threads/post-migration-link-problem.197848/#post-1534478

and post the thread. it would unfurl fine.

if i edit the post and remove the last bit #post-1534478, xenforo would ignore the link change. but if i post a clean link, it would be processed just fine. this makes no logic as the link was changed through editing and it should have unfurled on editing. but somehow it doesn't.

one possible way to re-unfurl all links would be to truncate the unfurl table in database (DO NOT DO THIS LOL. XenForo does not refresh links historically it seems.). i haven't personally tried it because i have a feeling that it would kill all unfurled urls and they would not be processed again.

I thought this was connected to Cache BB Code output setting but it seems to have died with xenforo 1.x.
 
Last edited:
So it seems like URLs only unfurled if they are processed by the XenForo editor. They are added to the database. Never removed. I can still see the first URL I tried after updating to the version that added support for unfurling URLs. Cleaning that table basically killed all unfurled URLs. I am still not sure why XenForo ignores any editing in an existing URL. It should be treated as a fresh link because there is no identifier in the code.
 
This could be what's causing the error.
I replaced all url in database with find replace. That's how I loaded the database. Changing thousands of old urls due to migration can only be done from the database.
 
yeah. i am not sure if it has been reported as a bug before. this is something that xenforo developers should know as it seems to be by design. though i still do not get why the link does not get updated if i edit an existing link. would post it as a bug and see if it gets a response.

 
Last edited:
Back
Top Bottom