By ibrahim alaabed on Monday, 18 November 2019
Posted in General Issues
Replies 13
Likes 0
Views 641
Votes 0
Hi
I have migrated the articles from joomla to easyblog , but the migrator generated new article_id for each migrated article.
I want to force the migrator to use the same old Joomla's article id , not to generate a new one.
thats because I have previously added the article_id to the joomla's articles links , and need to still have the same link after migration ,

please to guide me which file to hack and where exactly to find that part of code . also how to change it .
I think the only possible way is modify the migrator behavior because the current behavior is only migrate the Joomla article content.

This is the file which process this migration :

JoomlaFolder/administrator/components/com_easyblog/views/migrators/view.ajax.php
JoomlaFolder/administrator/components/com_easyblog/includes/migrator/adapters/content.php


By the way, I would suggest you that set permanent 301 redirect in your .htaccess file lets search engines and others know that an old link has been replaced by a new one.
·
Monday, 18 November 2019 18:25
·
0 Likes
·
0 Votes
·
0 Comments
·
please to help guiding me where to set that in the files,
its the last modification I need , then I can migrate my joomla articles and get the same entry id for each migrated article.

Ia screen shot of the code I must edited will be awesome.
thanks in advance.
·
Tuesday, 19 November 2019 18:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Please understand that our support policy does not cover customizations, this is definitely not only modify a few line of code then able to achieve what you want, you probably need to revamp the whole migrator behavior in order to achieve migrate the extra Joomla article id over to Easyblog.

If you really urgently to want this, you can always request for a quote from us at https://crm.stackideas.com and select "Customizations" . Our sales person would gladly send you a quote for the customization that you have requested.
·
Tuesday, 19 November 2019 18:53
·
0 Likes
·
0 Votes
·
0 Comments
·
ok
then only to tell me what exactly are the tables in easyblog database that stores the article id ,
then I will do a replacment via mysql after migration process.
·
Tuesday, 19 November 2019 19:01
·
0 Likes
·
0 Votes
·
0 Comments
·
These are the table will involved this :

#__easyblog_post
#__easyblog_post_category
#__easyblog_revisions
·
Wednesday, 20 November 2019 11:21
·
0 Likes
·
0 Votes
·
0 Comments
·
thanks a lot.
and if there where a tags migrated with the posts , is the tags tables record the articles id . and if yes , what are those tables .
sorry but this is the last question to get ready to try find a way handle that via mysql.
·
Wednesday, 20 November 2019 14:41
·
0 Likes
·
0 Votes
·
0 Comments
·
You're welcome, regarding the blog tag is under this table #__easyblog_post_tag .
·
Wednesday, 20 November 2019 15:38
·
0 Likes
·
0 Votes
·
0 Comments
·
I have added a simple article in joomla to test
then migrate it to easyblog via migration system

then changed the new easyblog post id from mysql in those 3 tables as you guide me
#__easyblog_post
#__easyblog_post_category
#__easyblog_revisions

now the easyblog post opened in easyblog composer , listed in easyblog posts tab with the correct old joomla id.

but I can't visit the post from frontend,
the url is broken with 404 error debugged as following:


Call stack
# Function Location
1 () JROOT/administrator/components/com_easyblog/includes/post/post.php:8120
2 EasyBlogPost->processPostIntroContent() JROOT/administrator/components/com_easyblog/includes/post/post.php:5271
3 EasyBlogPost->getPlainContent() JROOT/administrator/components/com_easyblog/includes/post/post.php:6818
4 EasyBlogPost->getContentImage() JROOT/administrator/components/com_easyblog/includes/formatter/types/list.php:97
5 EasyBlogFormatterList->execute() JROOT/administrator/components/com_easyblog/includes/formatter/formatter.php:53
6 EasyBlogFormatter->execute() JROOT/administrator/components/com_easyblog/includes/easyblog.php:3740
7 EB::formatter() JROOT/administrator/components/com_easyblog/includes/modules/modules.php:153
8 EasyBlogModules->processItems() JROOT/modules/mod_easyblogrelatedpost/helper.php:34
9 modRelatedPostHelper->getPosts() JROOT/modules/mod_easyblogrelatedpost/mod_easyblogrelatedpost.php:41
10 include() JROOT/plugins/system/t3/includes/joomla4/ModuleHelper.php:201
11 Joomla\CMS\Helper\ModuleHelper::renderModule() JROOT/libraries/src/Document/Renderer/Html/ModuleRenderer.php:98
12 Joomla\CMS\Document\Renderer\Html\ModuleRenderer->render() JROOT/libraries/src/Document/Renderer/Html/ModulesRenderer.php:47
13 Joomla\CMS\Document\Renderer\Html\ModulesRenderer->render() JROOT/libraries/src/Document/HtmlDocument.php:491
14 Joomla\CMS\Document\HtmlDocument->getBuffer() JROOT/libraries/src/Document/HtmlDocument.php:783
15 Joomla\CMS\Document\HtmlDocument->_renderTemplate() JROOT/libraries/src/Document/HtmlDocument.php:557
16 Joomla\CMS\Document\HtmlDocument->render() JROOT/libraries/src/Application/CMSApplication.php:1044
17 Joomla\CMS\Application\CMSApplication->render() JROOT/libraries/src/Application/SiteApplication.php:778
18 Joomla\CMS\Application\SiteApplication->render() JROOT/libraries/src/Application/CMSApplication.php:202
19 Joomla\CMS\Application\CMSApplication->execute() JROOT/index.php:49
·
Thursday, 21 November 2019 17:26
·
0 Likes
·
0 Votes
·
0 Comments
·
May i know which blog post you trying to access on frontend?
·
Thursday, 21 November 2019 17:32
·
0 Likes
·
0 Votes
·
0 Comments
·
ok
thanks
I have solved the issue
I will also share the quiry I used to set the old article id to the new migrated easyblog post id , it may be helpfull for some one ,
·
Thursday, 21 November 2019 21:03
·
0 Likes
·
0 Votes
·
0 Comments
·
You're welcome.
·
Friday, 22 November 2019 11:22
·
0 Likes
·
0 Votes
·
0 Comments
·
this is the mysql quiry I used after migration from joomla articles to easyblog posts to set all posts to their old ids in joomla.

UPDATE
_easyblog_post targetTable
INNER JOIN _easyblog_migrate_content sourceTable ON targetTable.id = sourceTable.post_id
SET
targetTable.id = sourceTable.content_id;

;

UPDATE
_easyblog_post_category targetTable
INNER JOIN _easyblog_migrate_content sourceTable ON targetTable.post_id = sourceTable.post_id
SET
targetTable.post_id = sourceTable.content_id;

;

UPDATE
_easyblog_revisions targetTable
INNER JOIN _easyblog_migrate_content sourceTable ON targetTable.post_id = sourceTable.post_id
Set targetTable.content = JSON_SET(targetTable.content, "$.id", sourceTable.content_id)

;

UPDATE
bqzce_easyblog_revisions targetTable
INNER JOIN _easyblog_migrate_content sourceTable ON targetTable.post_id = sourceTable.post_id
SET
targetTable.post_id = sourceTable.content_id;


;

UPDATE
bqzce_easyblog_post_tag targetTable
INNER JOIN _easyblog_migrate_content sourceTable ON targetTable.post_id = sourceTable.post_id
SET
targetTable.post_id = sourceTable.content_id;

;

UPDATE
bqzce_easyblog_meta targetTable
INNER JOIN _easyblog_migrate_content sourceTable ON targetTable.content_id = sourceTable.post_id
SET
targetTable.content_id = sourceTable.content_id;


this way I think all the tables in easyblog will be updated to use the old article id.

at lest it solved my issue and maybe someone will need it again.
Regards
·
Sunday, 24 November 2019 19:57
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for sharing.
·
Monday, 25 November 2019 11:19
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post