HOW TO SHOP

1 Login or create new account.
2 Review your order.
3 Payment & FREE shipment

If you still have problems, please let us know, by sending an email to support@website.com . Thank you!

SHOWROOM HOURS

Mon-Fri 9:00AM - 6:00AM
Sat - 9:00AM-5:00PM
Sundays by appointment only!
How to Move Magento to a New Host or Server
  • Step 1 Backup the Magento files:

Backup Magento files with tar command. Create a tar.gz backup file.

tar cfzv /home/myMagentoScriptBackup.tar.gz /var/www/
where:
c = create
f = file=ARCHIVE Use archive file (or device) ARCHIVE.
z = gzip, –ungzip filter the archive through gzip
v = verbose Operate verbosely tar.gz file is your destination path and file /var/www/ is what you want to copy.
  • Step2 Backup the Magento MySQL Database:

 mysqldump -uUSERNAME -pPASSWORD DATABASENAME > /someDirectory/dumpfile.sql 

where:
mysqldump - is a backup program used to dump a database or a collection of databases for backup or transfer to another SQL server.
-u indicates username to follow
-p indicates password to follow
DATABASENAME is your mySQL database name
/someDirectory/dumpfile.sql is the location and name of your mySQL dump file.

  • Step 3 Set up directory structure for files and create database + user on your new server

  • Step 4 Move files and database dump to your new server: via FTP, SSH,...

  • Step 5 Import database-dump : Restore Magento Database

    You may first have to create database and assign rights in mySQL.

    Restore database from SSH (Linux command line)

    mysql -uUSERNAME -pPASSWORD DATABASENAME  < /someDirectory/dumpfile.sql 
    
    where:
    -u indicates username to follow username
    -p indicates password to follow
    DATABASENAME is your mySQL database name
    /someDirectory/dumpfile.sql is the location and name of your mySQL dump file.
     

    You may have to delete and re-create database first if it already exists (this is simpler than clearing all tables). You may also have to GRANT ALL PRIVILEGES to specific user if you are not using default user to access mySQL.

    drop database DATABASENAME;
    create database DATABASENAME  DEFAULT CHARACTER SET UTF8 COLLATE UTF8_UNICODE_CI;
    
  • Step8 Reset base_urls in Magento

    These SQL commands will indicate to Magento the name of the secure (checkout) and unsecure (everything else) base_urls

    UPDATE core_config_data SET value= 'http://MYSITE.example.com/' WHERE path= 'web/unsecure/base_url';
    
    UPDATE core_config_data SET value= 'http://MYSITE.example.com/' WHERE path= 'web/secure/base_url';
    
  • Step 9 Restore Magento scripts

    If old copy of target Magento directory is already on the target server, you may want to remove it.

    cd /var/www/
    rm -r MYSTORELOCATION
    
    or
    
    rm -r /var/www/MYSTORELOCATION
    

    Use tar command to restore backed up files

    tar zxvf  /home/myMagentoScriptBackup.tar.gz 
    
    where:
    -z, –gzip, –ungzip filter the archive through gzip
    -x, –extract, –get extract files from an archive
    -v, --verbose Operate verbosely
    -f, --file=ARCHIVE Use archive file (or device) ARCHIVE.
    -C, --directory DIR Change to directory DIR before performing any operations.
    -r, delete recursively
     

    Depending how you created the backup, you may have to move the restore to the correct location.

     mv /var/www/MYSTORELOCATION/var/www/MYSTORELOCATION/  /var/www/
    
    or a recursive copy
    cp -R /var/www/MYSTORELOCATION/var/www/MYSTORELOCATION/  /var/www/
    

    You may also want move the directory it with the move command if old name is not the same as new name.

     mv OLDNAME MYSTORELOCATION
    
  • Step 10 Set SQL username and password in Magento

Indicate to Magento correct SQL username and password. This is contained in app/etc/local.xml. In XML below, make sure that host, username, password and dbname correspond to values in mySQL database.

vi /var/www/MYSTORELOCATION/app/etc/local.xml 
  • Step 11 Clear cache

Remove cache and session data imported from source server. This is more important than you may think. Many apparent problems can be resolved by clearing the cache.

rm -rf /var/www/MYSTORE/var/cache/m* 
rm -rf /var/www/MYSTORE/var/session/*
  • Step 12 Check file ownership

Find the web server user. This is usually the user 'apache'. To do this:

grep User /etc/httpd/conf/httpd.conf

change the owner of all files and directories in your magento root directory. Example:

chown -R apache /var/www/magento
  • Step 13 Verify permissions

These are recommended permissions as per Magento documentation. The idea is to give minimal required permissions.

400 permissions for files (-r--------) prevent any user (even the web server user) from overwriting files. This prevents attacks that depend on overwriting existing files with malicious content.

500 permissions for directories (dr-x------) gives the web server user read and execute privileges to prevent the accidental deletion or modification of files in the directory. Other users have no access to Magento directories.

700 permissions (drwx------) for the media/ and var/ directories give full control (that is, read/write/execute) to the owner and no permissions to anyone else.

600 permissions (-rw-------) for files in the media/ and var/ directories enable the web server user to write to them and to overwrite them.

To adjust persmissions

find . -type f -exec chmod 400 {} \;
find . -type d -exec chmod 500 {} \; 
find var/ -type f -exec chmod 600 {} \; 
find media/ -type f -exec chmod 600 {} \;
find var/ -type d -exec chmod 700 {} \; 
find media/ -type d -exec chmod 700 {} \;
chmod 700 includes
chmod 600 includes/config.php

Two additional places where program dynamically creates and deletes files

chmod 660 var/locks
chmod 777 var/locks  - verify?
chmod 660 /var/log

Note that other custom modules may require different permissions.

 

  • Step 14 Test

 

goto your site and test...

http://MYSITE.example.com/

 

 


 

SIGN IN YOUR ACCOUNT TO HAVE ACCESS TO DIFFERENT FEATURES

CREATE ACCOUNT

FORGOT YOUR DETAILS?

TOP