Huge Url Mess After Upgrade From 4.1.5 To 4.2.2

I upgraded my site last night because of a problem with USPS shipping rates.



Watching my Google Analytics in Real Time mode on and off this morning I couldn't figure out why so many people are getting 404 page not found.



Come to find out the upgrade messed up any URL on my site where the product name has a period. So for instance,



Praying and Reading by G. K. Scott



Before upgrade the URL is:



/praying-and-reading-by-g-k-scott.html



After upgrade the URL is:



/praying-and-reading-by-g.-k.scott.html



<>



Now I have to track down every URL that has a period and fix it before the search engines index these faulty URLs.



I've had this happen before when upgrading.



Is there a simple fix for this?

export just product codes and seo names fields as a .csv with comma delimiter





in excel open as tab delimited so each field is in its own column highlight seo name column, and do a find replace.

" Find . " “replace with” nothing…replace all.



I see some may end up double dash so in that case then do “find–” replace with “-”



import back in



Similar lesson earned previously also by me. I always export all product data before and after update then do file compare

John

Awesome. Thanks!



It forces me to export “Language” in addition to product code and seo name. Is that OK?

OK I did that and it worked.



THANK YOU THANK YOU THANK YOU!!

:grin:

on a side note, I decide to search google or your book, “[color=#282828][font=arial, verdana, tahoma, sans-serif]Praying and Reading by G. K. Scott”[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]and bang on top of the first page came this very post from cs cart forum…now you only posted that 30 mins ago according to my time, so how does this site get indexed by Goog so quick?[/font][/color]



edit…the google listing shows posted 11 hours ago, how is that ??

[color=#282828][font=arial, verdana, tahoma, sans-serif]John[/font][/color]

Ha! That’s funny because I just made that up! :-)



Google loves CS-Cart I guess. :-)

so now I just searched, the text i just typed 10 minutes ago



[color=#282828][font=arial, verdana, tahoma, sans-serif]“export just product codes and seo names fields as a .csv with comma delimiter”[/font][/color]



and once again google shows, it but as 11 hours ago…what is it, cached in my browser from this site or something, there is no way that was crawled in 10 mins, surely

Just noticed I have the same problem with any pages that have a period in the name–I have a quite a few. Any quick way to fix these or is it all manual one by one?

what you have seo names with “–” if so do as I mentioned above and find “–” replace with “-”

No, I mean pages, rather than products. I have sample chapters from books, etc. So, using the example above, if I had a sample chapter on my web site it might be:



Sample Chapter from G. K. Scott



Before:

sample-chapter-from-g-k-scott.html



After:

sample-chapter-from-g.-k.-scott.html



I have several of those.

fraid not,categories may have to be done in bulk edit 1 by1



not too bad



select all categories, choose action edit selected, choose seo name





EDIT** sorry no I was getting confused with categories…content pages 1 by 1 Im afraid.

If you're brave enough…


UPDATE cscart_seo_names SET name = REPLACE(name, ".", "");

Does this problem appear only if . is used in product title?

I've got a build of v4.2 which has all of it's products imported via XML feed. I think the SEO Name is only generated once the product is opened in the admin editor and saved - I don't write it during the import.

They are also rendered on the fly, so any periods in my Page Title will be in the SEO URL.



I use some handy update queries for problems like this.

First I run this query (This removes any “periods” or “dots” from the product name):

UPDATE `cscart_product_descriptions`
SET `product` = replace(product,'.','')


Then I run this query (This sets the Page Title equal to the Product Name which I just updated above):

UPDATE cscart_product_descriptions
SET page_title = product


Then I run this query (This sets the Image Alt value equal to the Product Name):

UPDATE cscart_common_descriptions as t1
INNER JOIN cscart_images_links as t2 ON t2.detailed_id = t1.object_id
INNER JOIN cscart_product_descriptions as t3 ON t3.product_id = t2.object_id
SET t1.description = t3.product
WHERE t1.object_holder = 'images'




Your SEO name is built from the Page Title, so stripping out the periods from the page title makes certain that the SEO Name won't include those characters.

For any existing SEO Name changes, you need to run the update query that The Tool provided above:

UPDATE cscart_seo_names SET name = REPLACE(name, '.', '')



I do make a COPY of the table I am updating prior to running these queries and first run the query on the copy, so if I ever have a typo in one, I am not updating the actual working table. Copying tables with data and structure is easy in phpMyAdmin. I just add a number to the end of the new table name. Then DROP the copy after the work is done.

I have all the product SEO names fixed (thanks to John) and had to go and manually do the pages and categories.



My stuff has to have periods in the titles because they are author's names like A. W. Tozer, Patricia St. John, etc.



I just discovered another problem. I have “Author Name” as a feature and all those are messed up too. So I guess I'll have to fix all those manually…

I have the same problem with features. Artist Name contains periods and they end up in the SEO URL of the feature.

But if you run that UPDATE query that REPLACES the periods with nothing, it will fix everything in the SEO Names table.

OK. I will look into it. I'm not at all proficient in that stuff, so it makes me nervous.

Here's the safest way to proceed with mySQL queries:

Log into your cPanel, open phpMyAdmin. Click on the database name you are using and then in the left menu, click on the table named cscart_seo_names.

In the top menu click on Operations. There is a block named “Copy table to (database.table):”

In the text field the existing table name already appears, so I just add _copy at the end (so it looks like this: cscart_seo_names_copy). Make certain that Structure and data is selected for the copy and click on the Go button in the bottom right hand corner of THAT SAME block.

You just made a COPY of the seo_names table. You can now do anything you want to the copy - it's not used by CS-Cart.

So run your query on the COPY and look at the results. If you made a mistake, DROP the table (on the same Operations page) and make another copy. (Dropping means Deleting.)

So your tests on the COPY would be an update like this:

UPDATE cscart_seo_names_copy SET name = REPLACE(name, '.', '')

This way you are UPDATING cscart_seo_names_copy table (the copy).

Once your query gets you the results you want (on the copy), run it on the original working table and drop the copy.

In fact, you should probably make a FRESH COPY of any LIVE table you are going to update PRIOR to running queries on it.

When you make the copy, add _backup to the name.

This way, if you hose the LIVE working table, you can drop it and rename the _backup copy to the original's name.



I do this too for complex updates. It takes all the worry out of it.