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 […]
This little tutorial shows how to dump wildcard selected tables from a MySQL database. That’s useful if you don’t want to dump the whole database. Background Recently I had to export a few selected tables from a very huge database. For that I could have run a query like that to export only the required […]
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: SELECT table_name AS “Table”, round(((data_length + index_length) / 1024 / 1024), 2) “Size in MB” FROM information_schema.TABLES […]
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 […]
This can be done by the following database query: SELECT cs.store_id, csg.name AS group_name, cw.name AS website_name, cs.name AS store_name, increment_last_id AS last_increment_id, entity_type_code AS entity_code FROM eav_entity_store AS ees INNER JOIN eav_entity_type AS eet ON eet.entity_type_id = ees.entity_type_id INNER JOIN core_store AS cs ON cs.store_id = ees.store_id INNER JOIN core_store_group AS csg ON csg.group_id […]
The following query increments the last increment ids for all store by 100: UPDATE eav_entity_store AS ees INNER JOIN eav_entity_type AS eet ON eet.entity_type_id = ees.entity_type_id SET ees.increment_last_id = ees.increment_last_id + 100 WHERE eet.entity_type_code=’order’; The actual values for each store can be queried as shown in Get stores last order increment ids.