cancel
Showing results for 
Search instead for 
Did you mean: 

Restore Magento 2 attribute and related products

SOLVED

Restore Magento 2 attribute and related products

I have accidentally deleted the attribute set from the store and due to this the products also deleted from my multistore shops. by just pressing this

Screenshot.png

.

 

I have found an extension in GitHub trashcan but it says it will not restore the already deleted products.

I have not deleted the products just by mistake I have deleted the attribute set

also, I have not database backup so please any suggestion how I can restore the products with the same attribute?

My Magento version is 2.2.0

Thanks 

3 ACCEPTED SOLUTIONS

Accepted Solutions

Re: Restore Magento 2 attribute and related products

Hello @apetrail_RAJ

 

There is no way to restore it from the extension

 

Either you need to ask to server to give old db backup or you have old backup.

Mostly all server take db backup for security reasons.

Hope it will help you.

 

 

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

View solution in original post

Re: Restore Magento 2 attribute and related products

@apetrail_RAJ - You need to import that database using command line.

 

open your terminal then run below command :

 

mysql -u username -p database_name < /path/to/file.sql

 

where database_name = your database name

path = where you have puted the sql file of the database. 

 

After running this command It will ask you for password - so add your mysql password.

 

Or if you are logged in mysql command line then below is the alternative option :

 

From within mysql:

mysql> use db_name;
mysql> source backup-file.sql;

 

if issue solved,Click Kudos & Accept as Solution

View solution in original post

Re: Restore Magento 2 attribute and related products

You can install database using SSH, Using command line tools to import database is fast and reliable way for database.

You can import using command line to below way,

 

mysql -u {username} -p {databasename} < {path of sql file to import}

after hit above command ask for password and just type password,

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial

View solution in original post

16 REPLIES 16

Re: Restore Magento 2 attribute and related products

@apetrail_RAJ

 

Have you did on server?

 

then ask to server provide db backup.

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Restore Magento 2 attribute and related products

no sir i have deleted from admin end store attribute as mentions into the
screenshot and yes site is on live server. noy localhost

Re: Restore Magento 2 attribute and related products

Hello @apetrail_RAJ

 

There is no way to restore it from the extension

 

Either you need to ask to server to give old db backup or you have old backup.

Mostly all server take db backup for security reasons.

Hope it will help you.

 

 

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Restore Magento 2 attribute and related products

thanks sir should i upload whole database or only attribute table?

Re: Restore Magento 2 attribute and related products

@apetrail_RAJ - From Magento 2 Application side there is no option to restore those attributes and attributes sets. 

 

But as you mention the data and application is on server - so you can ask your hosting provider to RESTORE the latest snapshot of backup they have taken.

 

For security side hosting provider always take a backup on daily or weekly basis , so they will definitely help you on this issue. 

if issue solved,Click Kudos & Accept as Solution

Re: Restore Magento 2 attribute and related products

@apetrail_RAJ

 

you need to upload whole db

 

Becuase you don't know how many table effect while creating new attribute or attribute set.

 

If it will help you then mark as solution.

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Restore Magento 2 attribute and related products

i have craeted attribite again should i delete it feom admin end? also i
have multiple store and its effect on all store if i restore the db then
all will be fine.

Re: Restore Magento 2 attribute and related products

@apetrail_RAJ

 

If you are setup new db and use that db then all thing you did  will be lost.

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Restore Magento 2 attribute and related products

@apetrail_RAJ - Yes just restore the latest version of backup they have taken , that will restore everything including your attribute sets which is affecting on all the stores as you have multiple stores so.

if issue solved,Click Kudos & Accept as Solution