He Guys,

I'm hoping you can help me out. I'm a complete novice when it comes to SQL.

I'd like to move all the SKU values of every product to a new custom attribute (with attribute code: locaitenr)

after this is done I'd like to clear (reset) all the SKU numbers. It would help me tremendously if someone could help me out with a SQL statement.


1 Answer 1


To move all SKUs to a new custom attribute, you can accomplish that by using product export/import process.

It isn't quite easily to clear the SKU number on each product mainly due to it being use as a product unique identifier. If you want to replace the old SKU with a new one, consider writing scripts that will load product individually by the old SKU, update the SKU to the new one, and then save the product. This process may take awhile to accomplish. (See the relevant question as an example https://stackoverflow.com/questions/28350783/how-to-replace-the-sku-number-for-5000-products-in-magento). This approach will be safer than edit SQL directly since there may be some dependencies to the old SKUs that may end up breaking the system if the reference got altered via SQL DB.

Another option is to export the product to CSV, update the SKU numbers (and move the old SKU to the column for the new custom attribute), then reimport everything into the system.

Hope that helps and good luck!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.