How to change invoice number in Magento

Found this in the Magento Forums.
If you look in the eav_entity_store table, you’ll find where they store the increment prefix and the last ID used for the various IDs. You can change the last ID to start at a different number.
See eav_entity_type for which type is which ID field. This table also has the increment_model field which is how the ID is incremented. You can set the pad character and length too.
If there is not an entry for the number you want to change, just add it.

How to restore data in Magento from a backup

I found this solution on the Magento forum, so all credit goes to the original poster. I added it here to make it easier to find.

The Magento database makes use of foreign key constraints to ensure database integrity. As an example, if a category is deleted, all categories below it in the category tree must be deleted too.

If you make a backup of your Magento database using the built-in backup function (Admin > System > Tools > Backup), Magento inserts special statements in the .sql file to avoid foreign key checks when the tables are restored.

If you backup your Magento database using other tools, like phpMyAdmin or Navicat, these special statements will be missing. When you attempt to run the .sql file, you will get errors like these:

Cannot add or update a child row: a foreign key constraint fails

This error occurs because the data you are importing is provided table by table, row by row, without regard to the logical structure and integrity of the database.

To restore a .sql file backup without constraint checking, simply add the following statements at the beginning of your .sql file:

SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;
SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;
SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;
SET NAMES utf8;
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=’NO_AUTO_VALUE_ON_ZERO’;
SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0;

At the end of the file, add the statements required to turn on constraint checking again:

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT;
SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS;
SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION;
SET SQL_NOTES=@OLD_SQL_NOTES;

With these modifications, you should be able to restore your Magento database from a .sql file backup created with any tool.

Hope this helps.

How to Customize Magento Packing Slips and Invoices

It’s pretty obvious you will want to customize your packing slips and invoices you use in Magento with your company logo and address information. We’ve seen some posts in the various forums that suggest modifying core code files in Magento. DON’T! It’s actually very simple to customize your packings slips and invoices in Magento.

First, log in to your Magento admin. Go in the top menu to “System>Configuration”. Make sure you have selected your store view near the upper left corner under “Current Configuration Scope”.

Look in the left column and go to “Sales>Sales”. You’ll see a selection on that page for “Invoice and Packing Slip Design“.

Enter your info and there you are, customized packing slips and invoices in Magento.