Search code examples
magentosuphp

Moving Magento from server to SuPHP server


I have a nice Magento server and need to move to other server host

Moving Magento from Php 5.2.17 server to SuPHP server

All my file permissions are bogus on new server and nothing works. What do I need to change, or what is the proper way to move Magento to a SuPHP server (from non SuPHP)

METHOD 1 -> Current process:

Old server

  1. remove session/cache/etc
  2. tar gz all + SQL dump

New server (SuPHP)

  1. untar gz + upload SQL
  2. update SQL server in local.xml
  3. update core_config in database

METHOD 2 -> Idea

  1. Re-install + upload old DB
  2. Copy only certain folders (but then I dont know how to copy over extenions etc)

What should/can I change to make Magento SUPHP work?


Solution

  • To add a log of my experience. Thanks to Fiasco Labs.

    Main steps

    On old server

    1. Important! Disable cache in admin, remove, clear any cache (also from extension like zoom, APC)
    2. Follow guidelines as below (create site backup in tar.gz)
    3. Execute SQL dump via prompt or via directadmin or other

    On new server

    1. Place tar in public html and extract (can also be done via directadmin filemgr)
    2. upload SQL
    3. update settings in local.xml
    4. update urls in core_config in database
    5. Set chmod app/etc/local.xml 600 (no write to stop error messages in log)

    # GOTO MAGENTO ROOT PUBLIC_HTML
    mkdir ../backup
    cp -rf * ../backup
    cd ../backup
    
    # VERIFY THAT YOU ARE IN DIRECTORY BACKUP
    # REMOVE ALL CACHE RELATED FILES IN HET BACKUP FOLDER
    rm -rf var/cache/* var/session/* var/zoom/* var/minifycache/* downloader/pearlib/cache/* downloader/pearlib/download/* downloader/pearlib/download/* downloader/pearlib/pear.ini var/cache/* var/backups/* var/report/* var/log/* var/locks/*
    
    # SET FILE RIGHTS CORRECTLY FOR SUPHP
    find . -type f -exec chmod 644 {} \;
    find . -type d -exec chmod 755 {} \;
    chmod 550 lib/pear
    chmod 550 mage
    
    # MAKE DIRS READABLE
    chmod -R 777 var media
    chmod 777 media var/cache/ var/session/ var/zoom/ var/minifycache/ downloader/pearlib/cache/ downloader/pearlib/download/ downloader/pearlib/download/ downloader/pearlib/ var/cache/ var/backups/ var/report/ var/log/ var/locks/
    
    # TAR AND GZ
    tar -czpf backup_mage.tar.gz .