Magento “Invalid website id requested.” error in backend on product save

Today I got a error in the Magento  backend telling me, that I have requested an invalid website_id (Invalid website id requested.), when I tried to save a product. The problem was, that I had deleted unused websites and stores over the Magento backend. Unfortunately Magento seemed to keep the relation between website and product, although […]

Get table or DB size im Megabyte

Sometimes it is really useful to know how large a certain database table has become. With the following SQL statement you get a list of all tables of the currently connected database with their rounded size in MB:

This query selects all tables from all connected databases. If you want to select a certain […]

Prevent unwanted email delivery

If you have multiple instances of a Magento shop – for example a staging and a production environment – sooner or later you’ll come to the point, where you need to  synchronize the database from live- to stage-system to get realistic production-like application behavior. In this case it is a good idea to prevent the system from sending mails […]

Get stores last order increment ids

This can be done by the following database query:

To change or increment the increment ids of all stores, have a look at Increment order increment ids for all stores.

Increment order increment ids for all stores

The following query increments the last increment ids for all store by 100:

The actual values for each store can be queried as shown in Get stores last order increment ids.