I wanted to remove a product from my featured products list so I soft deleted it. Anyone know How I can undelete this?
Thanks
I wanted to remove a product from my featured products list so I soft deleted it. Anyone know How I can undelete this?
Thanks
There are two ways to do that:
1. In the product manager's page where you deleted that product, there's an 'Undelete' link there you can click.
2. Or, you can run an update sql command and set deleted=0 directly against your DB (e.g. update product set deleted=0 where productid=theproductid)
**Make a full DB backup before running the script, just in case.
the original product was created in category4 but was also mapped to category1
click--categories-category1
click on "products" tab"
click on "products for category" tab
Should I be looking somewhere else?
I only see the products in this featured category. There is no undelete link
Thanks
Undeleting through the Product Manager page is actually a feature of ML9, which'll be out real soon. For the moment, you'll need to just run a SQL query like the one Alfred mentioned:
UPDATE Product SET DELETED=0 WHERE ProductId=theidoftheproductyouwantrestored
OK thanks
Where do I find the product ID of the product I deleted?
You'll just have to find it in the Product table. Either open the table in SQL Studio Management Studio and find it, or something like
SELECT ProductID FROM Product WHERE Name='the name of the product you deleted'
Thanks again for your help. I could not find the product in the table ..although I am not even sure if I even looked in the correct table as there are millions of them!
Anyway I have backups so would you suggest I do an entire backup or is there a specific folder I should only backup to recover the lost product? The reason I need to recover it is I spent alot of time on wording the description and forgot what I wrote. That is really the only thing I need back.
Thanks
A full backup is definitely we recommend. You can try finding that product by names, say for example, SELECT PRODUCTID,DELETED, * FROM PRODUCT WHERE NAME LIKE '%KEYWORD%' and DELETED=1 - When this is ran, it returns all rows that contains the keyword you specified there. Once you found the ProductID, run the query given by Scott.
** KEYWORD = at least one word you can remember for that particular product.
Have you deleted more than one product? If not just update product set isdeleted=0 where isdeleted = 1
I only deleted 1 product.
I want to make sure I do this right.
In SQL Server management express:
Expand Databases
Right click my aspdnsf_db
Click new Querry
type in exactly: update product set isdeleted=0 where isdeleted = 1
Execute
I get this error:
Msg 207, Level 16, State 1, Line 1
Invalid column name 'isdeleted'.
Thanks for your help!
In the upper left of your management tool there is a dropdown .. does it say "master"? If so change that to aspdnsf_db
Thanks SS,
I dont have a tab like that maybe becasue I am using express?
Here is my structure
Servername
Databases
system databases
master
model
msddb
tempdb
aspdnsf_db
database diagrams
tables
views
synomyns
programmability
security
I can right click aspdnsf_db and enter a new querry but that is where I get the error.
My bad, or our bad
the column is just deleted not isdeleted
**** YOU DID MAKE A BACKUP CORRECT?
Umm YEAH! The famous words. No I didn't actually but if my whole store gets wiped out not a big deal. I have a few hours into it anyway just setting up a few products and categories. I do have 10 days full backups though.
I am going to try the deleted command now. Thanks very much for helping me here.
Let me know how it goes.
Also a backup is quite simple to do, right-click on the db and under Tasks select full backup (dont remember the exact verbage) ... probably not a big deal for this current issue but in the future you may want to do this before any big changes
Thanks again.
This time I executed that command (deleted) it showed "3 rows" undeleted or something like that. But there was no error.
But sadly the product is not back..
Not sure what 3 rows came back but I dont see any difference..yet.
Also I did do a search in the admin for this product and it shows up.
When I click on it it gives an error in admin..
if this message helps here is part of the error.
Thanks for your help. Not a big deal I will rebuild that product.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 1931: protected void SetVariantButtons()
Line 1932: {
Line 1933: string temp = ("<a target=\"entityBody\" href=\"entityProductVariantsOverview.aspx?ProductI D=" + pID + "&entityname=" + eSpecs.m_EntityName + "&EntityID=" + eID.ToString() + "\">Show/Edit/Add Variants</a>");
Line 1934:
Line 1935: ltVariantsLinks.Text = temp;