0

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?

snh_nl
  • 2,877
  • 6
  • 32
  • 62
  • Is this on a unix server? Don't use zip. Zip files know less than nothing about unix permissions. Use tar+gzip – Marc B Jul 14 '12 at 17:15

2 Answers2

2

SuPHP file permissions expects directories to be set 755, files to be set to 644 and ownership of the files to be set to the user and group that SuPHP expects.

Usually under SuPHP, the user and group owners have the same name, replace $user with your assigned account name. The following are executed in Magento's root directory.

chown -R $user.$user *

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
chmod 550 pear
chmod 550 mage #for magento 1.5+

Before doing your tar file and database backup on the old system, do yourself a favor, go into Magento Admin and disable all caching and make sure the compiler is shut off.

This will save you from having certain issues on the new server till you have the baseURL settings changed and file/directory permissions properly set. AFTER you have Magento up and running properly, enable the Magento caching. Make sure everything's running, flush the cache and then (if you were using it before) recompile and only after recompile, then enable the compiler.

Fiasco Labs
  • 6,457
  • 3
  • 32
  • 43
  • Thanks. Have you actually done it? + on the new server I have no SSH, so I did everything on old server (on the new server I just untar, edit DB and local.xml). Files are all OK now with rights.But still I am now stuck with a white page (and no errors) + I see now my pear is missing. Is this bad? – snh_nl Jul 14 '12 at 18:58
  • 1
    Servers without SSH access, uugh! Done it successfully, yes. Since no version was mentioned, 1.5 and above do not have pear, they use mage instead. – Fiasco Labs Jul 14 '12 at 19:04
  • 1.7.0.2. Just cant get it to work. Did all on old server. Then update local.xml and reset paths in core_config: http://shirtft81.eightyone.axc.nl/ – snh_nl Jul 14 '12 at 19:41
  • Well, just clicked the link and you're definitely getting more than the white screen of death. When I view source, links to css show the following: `http://shirtft81.eightyone.axc.nlmedia/css/ed13632b06af38d167b14286237681bf.css` which shows a missing trailing slash in the secure_base_url and unsecure_base_url in your System Config - General - Web settings. As @Tim points out. Once that's corrected, you should be getting images, css and javascript as well as having links off the home page actually start to work. Also make sure your memory_limit is set to something like 256M or more. – Fiasco Labs Jul 15 '12 at 02:25
  • I was playing with option 2. Reinstall + upload media config etc separartely. Still strange. – snh_nl Jul 16 '12 at 12:37
0

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 . 
snh_nl
  • 2,877
  • 6
  • 32
  • 62