Forums / General Questions / Need advice/tips/etc for migrating products

Need advice/tips/etc for migrating products

Locked

Views: 1,055

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
2 Dec 2006, 8:33 AM
#1
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Need advice/tips/etc for migrating products

knowing too little is far worse than knowing nothing at all...

My "old" (currently live) site was set up before I really knew what I was doing. My "new" site is almost ready and its time for me to migrate the db over.

However, due to modifications and stupid setups, its not as easy as you might think. The main problem is that my previous site had pretty much two copies of every product... one in my "in-store items" section and another in my "special order" section... my store has a lot of products that I don't carry in stock so I had to treat them differently. At the time, I thought it would be a good idea to duplicate everything and then turn on/off the status of the one I didn't need.

Ok ok... it seemed like a good idea at the time.

But now with my new site I know better and I want just one set of data.

The problem is a few things:

  1. Customer looks up an old order and now that product doesn't exist. I'm not sure if this is a problem or not... is it?

  2. Links that I put on other sites (forums, etc) linking back to specific products that no longer exist.

I don't even know what I'm asking for... I just don't really know how to procede.

I considered coming up with some mod that relates old product id(s) to the appropriate new id, so that a request for the old product page is automatically forwarded to the new one... but that seems messy.

Oh lord... and I have to deal with reviews, sales reports.... yikes.

what a headache.

  • Steven
2 Dec 2006, 9:00 AM
#2
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Need advice/tips/etc for migrating products

:shocking: Now I understand what you said earlier about not knowing how to migrate.

Sorry, no ideas right now (but when I think of something later I will let you know of course).

How many products are you talking about approx.?

2 Dec 2006, 9:03 AM
#3
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Need advice/tips/etc for migrating products

about 120ish

2 Dec 2006, 9:54 AM
#4
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Need advice/tips/etc for migrating products

I think I'll keep all the products as-is... but put all the dups into a hidden folder (look for my hideCategories contrib) then change all their descriptions to a link to the "correct" product... that'll take care of external links.

If I want good reports, I should go through and merge all the "how many bought" and the reviews and such. I wish I was at a level of understanding back then that would have allowed me to forsee this :)

Ahhh... I'll figure it out after I sleep on it.

  • Steven
2 Dec 2006, 10:47 AM
#5
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Need advice/tips/etc for migrating products

I guess merging the reviews can be done by simply editting the products_id for each review (saying that without having looked at the datatable...). And, if that's correct, it's not that much work for the amount of products you need to migrate.

And I think I would use a .htaccess redirect for the products/copies to their new product_id's. That way you can also send a "permanently moved" (or whatever it's called) message to the SE's.

Can't give you an example on how the .htaccess redirect is done, I would have to look it up myself too.

2 Dec 2006, 6:15 PM
#6
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Need advice/tips/etc for migrating products

Thanks... I didn't know you could do that. I don't really know anything about .htaccess... time to learn!

  • Steven
2 Dec 2006, 8:37 PM
#7
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Need advice/tips/etc for migrating products

It can be done with rewrite rules.

The Ultimate SEO url's contribution includes this .htaccess as example:
(of course you need something completely different, but I think it indicates what is possible and how it works)

NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /shop/

From Ultimate SEO URLs

RewriteRule ^(.)-p-(.).html$ index.php?main_page=product_info&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-c-(.).html$ index.php?main_page=index&cPath=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-m-([0-9]+).html$ index.php?main_page=index&manufacturers_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.
)-pi-([0-9]+).html$ index.php?main_page=popup_image&pID=$2&%{QUERY_STRING} [L]
RewriteRule ^(.)-pr-([0-9]+).html$ index.php?main_page=product_reviews&products_id=$2&%{QUERY_STRING} [L]
RewriteRule ^(.
)-pri-([0-9]+).html$ index.php?main_page=product_reviews_info&products_id=$2&%{QUERY_STRING} [L]

For Open Operations Info Manager

RewriteRule ^(.*)-i-([0-9]+).html$ index.php?main_page=info_manager&pages_id=$2&%{QUERY_STRING} [L]

For dreamscape's News & Articles Manager

RewriteRule ^news/?$ index.php?main_page=news&%{QUERY_STRING} [L]
RewriteRule ^news/rss.xml$ index.php?main_page=news_rss&%{QUERY_STRING} [L]
RewriteRule ^news/archive/?$ index.php?main_page=news_archive&%{QUERY_STRING} [L]
RewriteRule ^news/([0-9]{4})-([0-9]{2})-([0-9]{2}).html$ index.php?main_page=news&date=$1-$2-$3&%{QUERY_STRING} [L]
RewriteRule ^news/archive/([0-9]{4})-([0-9]{2}).html$ index.php?main_page=news_archive&date=$1-$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.)-a-([0-9]+)-comments.html$ index.php?main_page=news_comments&article_id=$2&%{QUERY_STRING} [L]
RewriteRule ^news/(.
)-a-([0-9]+).html$ index.php?main_page=news_article&article_id=$2&%{QUERY_STRING} [L]

All other pages

Don't rewrite real files or directories

RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*).html$ index.php?main_page=$1&%{QUERY_STRING} [L]

Time to learn regular expressions (unless you already know all about it of course :-) ).

2 Dec 2006, 8:47 PM
#8
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Need advice/tips/etc for migrating products

Of course you would need quite a lot of rewrite rules (assuming there is no logic relation between the products_id and the copy products_id). I am not sure if that many rewrite rules would be the best way to solve this problem. But maybe it is.

3 Dec 2006, 6:31 PM
#9
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: Need advice/tips/etc for migrating products

Thanks again Paul... that is very helpful. I'm not a big fan (yet) of regex... I see the power, but just enough for it to give me headaches. :)

This is turning out to be slow... but not a terrible process. I moved all the products into a "hidden" folder (again, look for my hideCategories contrib for info) and then I'm moving them back into their proper locations one at a time. I'm only doing it this way because my folder structure is completely different now so there was no point retaining folder locations. Once I'm finished that, I'll take care of the duplicates, which is a two-step process: 1) Find all references to the duplicates in things like reviews, etc and change them to the single one. Also add the "number purchased" from both copies and put the sum into the single one. 2) Deal with the link issue. For #2, its either going to be as you suggest above if I can wrap my head around it, or simply change all the descriptions to "This product has moved, please use the search feature" or something like that if I feel to drained to be creative when the time comes.

I wish I didn't split the products up like that in the first place!!! It seemed like such a clever solution at the time.

  • Steven