Inhalte aufrufen

Profilbild

Bug: Existing Topics are not migrated properly during upgrade


8 Antworten zu diesem Thema

#1 nickh

nickh

    Advanced Member

  • Members
  • 91 Beiträge

Geschrieben: 05 June 2018 - 23:14

Hi.

 

I had a number of Topics created using version 2.5 of Smartstore.  After upgrading to v 3.1, I noticed that the URLs for the existing topics are missing.  After further investigation, it looks like the code expects a DB entry in the UrlRecord table for each topic, but there are no rows with an EntityName value of Topic.  Newly created topics (after the v3.1 upgrade) are correctly added to the UrlRecord table.

 

How should I go about resolving this?


  • GalenKa, RidgeOi und Brantot gefällt das

#2 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3286 Beiträge

Geschrieben: 06 June 2018 - 13:29

Starting with version 3.1.5 there are slugs for topics. The migration that adds them is TopicSlugs. One thing you can do is to rollback migration to a state before TopicSlugs so that the migration runs again. Can be done by entering 
update-database -TargetMigration V310Resources
for data project in the Package Manager Console and restarting the shop.

  • GalenKa und RidgeOi gefällt das

Schöne Grüße aus Düsseldorf,
Marcus Gesing


#3 nickh

nickh

    Advanced Member

  • Members
  • 91 Beiträge

Geschrieben: 06 June 2018 - 14:08

Hi Marcus,

 

I see, but when I did the upgrade it included all migrations up to V315Resources, so why would the TopicSlugs migration not have been applied when I first restarted the shop after the upgrade?


  • GalenKa und RidgeOi gefällt das

#4 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3286 Beiträge

Geschrieben: 06 June 2018 - 14:25

That's a good question. I don't know why. Is TopicSlugs included in __MigrationHistory table? This would mean that in your case the migration has been executed but never inserted any data.


  • GalenKa und RidgeOi gefällt das

Schöne Grüße aus Düsseldorf,
Marcus Gesing


#5 nickh

nickh

    Advanced Member

  • Members
  • 91 Beiträge

Geschrieben: 10 June 2018 - 21:35

Hi Marcus,

 

Sorry for the delay.  Yes, TopicSlugs is in the MigrationHistory table (immediately after 201804200835273_V310Resources).  How do you suggest I proceed?


  • GalenKa und RidgeOi gefällt das

#6 Marcus Gesing

Marcus Gesing

    SmartStore AG

  • Administrators
  • 3286 Beiträge

Geschrieben: 11 June 2018 - 08:02

I would rollback migration to V310Resources for the data project in the Package Manager Console: 
update-database -TargetMigration V310Resources
 and then restart the shop.

  • GalenKa gefällt das

Schöne Grüße aus Düsseldorf,
Marcus Gesing


#7 nickh

nickh

    Advanced Member

  • Members
  • 91 Beiträge

Geschrieben: 12 June 2018 - 15:21

When I attempted to do this it caused further issues when trying to construct certain objects (don't have the exact error message), so I wondered if I could just write a SQL script to add a UrlRecord entry for every existing Topic.  Is this all that is required?  Would this even work?



#8 Murat Cakir

Murat Cakir

    SmartStore AG

  • Administrators
  • 1076 Beiträge

Geschrieben: 12 June 2018 - 19:33

so I wondered if I could just write a SQL script to add a UrlRecord entry for every existing Topic.  Is this all that is required?  Would this even work?

 

Yes, it would, absolutely. In fact, it's even easier than that; just enter the desired SE slugs in the backend and save the topics (CMS > Topics > {Topic} > SEO > Search engine friendly page name)


Murat Cakir
SmartStore AG


#9 nickh

nickh

    Advanced Member

  • Members
  • 91 Beiträge

Geschrieben: 12 June 2018 - 21:56

That worked perfectly!  Thanks a lot.





Auf dieses Thema antworten