SSH backup website

Well sometimes it is time consuming and very irritating to backup a website using FTP/web interface.

Login using SSH on your website.

Via terminal (apple), putty (windows), use the following commands:
mysql db:  mysqldump -u dbusername databasename -p > outputfile.sql
websites:   zip -9 -r [relative folder to path] unzip

then download it via your website. FTP goes too slow.

And your done…


Restore database:

Create in the destination server a new database, user for the new database, and password for the user to that database. Let us say that the three you created are respectively, database_name, database_user, and database_password.

Download the dump file to the destination server from the origin server. Issue the following command:

mv dump.gxx dump.sql

What is the meaning of the code above?
The line wget will download the file dump.gxx to the destination server. That is the reason why I work under public_html directory of the origin server so that I can access the file easily. The code mv dump.gxx dump.sql rename the file dump.gxx to dump.sql.

Finally start the import process,
mysql -u database_username -p -D database_name --default_character_set utf8 < dump.sql

It will ask you a password, give the database_password you just created.

Magento: Fatal error: Allowed memory size of X bytes exhausted (tried to allocate Y bytes)

Usually this is due to an miscoded or misguided error, but in case you try to login into magento on the front end, and you get this message, think back!

In our case, we made an account field mandatory. When a user tried to login and he/she did not fill that field before we made it mandatory, than the above message can occur.

MySqlD does not start in newest OSX Yosimite version.

Start Terminal and sudo as root user

In you Applications folder find your installation. For magento bitnami you will find magento-version.. so you will have to look for it.

In …/mysql/scripts/ edit the file

Right after #!/bin/sh  add on a new line:     unset DYLD_LIBRARY_PATH


And start all.

Suspect fraud paypall payments magento

Sometimes when using paypall, rounding vars are not set ok.  0.0003 eur difference, gives a fraud detection.

Change the source. (make sure you work in local, not core.)

Then, change the following tables:

  1. sales_flat_order:  Change state and status columns both to ‘processing’
  2. sales_flat_order_grid: Change status to ‘processing
  3. sales_flat_order_status_history Change status to ‘processing’

Then you can work with your order/invoice again…

Multiple magento installations and invoice numbers

eav_entity_type table has some settings you might be careful about using. But still, sometimes it is needed.

To separate invoice number ranges, use 1 in field ‘increment’. To share the number, use 0.

This can also be applied with the other ranges…