Fixing Symlinks on Windows

“The symbolic link cannot be followed because it’s type is disabled.”

Quite an easy fix tbh, you can check status with this command:

mintty screen dump

fsutil behavior query SymlinkEvaluation
Local to local symbolic links are enabled.
Local to remote symbolic links are enabled.
Remote to local symbolic links are disabled.
Remote to remote symbolic links are disabled.

As you can see, network symlinks are disabled on this machine in work I’m on. To fix it, run the following:

mintty screen dump

fsutil behavior set SymlinkEvaluation R2R:1
fsutil behavior set SymlinkEvaluation R2L:1

That fixes remote to remote (R2R) and remote to local (R2L), obviously the other two types are L2R and L2L.


Moving a Live Magento Site to a Local Server


This job seems to get more interesting and fun by the day!

Today, it’s Magento! The mission? To move an existing Magento Store from Live hosting out there to another hosting provider, and then reskin it. And inbetween we’re going to miove it onto my local apache install.

Download the files, and setup your hosts and vhosts as per usual. However! localhost or whatever you call it will not be enough apparently, it likes a FQDN (fully qualified domain name.), so I called mine http://magentolab.del

Export the MySQL DB. Apparently the best way to do that is through the admin section of the magento site, as PHP MyAdmin does not bother with the Foreign Key Constraints of InnoDB, and you may get import errors if you do it that way. Your mileage may vary.

Import your SQL dump into MySQL, then run this command (your tables may or may not have the ‘mage_’ prefix, delete as appropriate)

select * from mage_core_config_data where path like "%base_url%"

Change the url to your local address. Put a trailing slash on the end of it!! Restart Apache, browse to your site, and watch it FAIL! Ok, now to set it up some more. Open it up in your favourite IDE, and look for app/etc/local.xml.
That’s where you’ll find settings regarding your DB connection. Edit to suit.

Now, you’ll probably not be getting to see your exceptions on screen. You’ll find them hidden away in var/report.

In my case, I was getting an exception that stated: Illegal scheme supplied, only alphanumeric characters are permitted

Again, the FQDN issue I described was part of this, but not all. We need to comment some other stuff out.
Dig into the app/code/core/Mage/Core/Model/Session/Abstract/ folder and open Varien.php. Jump to line 85 (as of v1.6.1)
Comment out some of the array like so:

  // session cookie params
        $cookieParams = array(
            'lifetime' => $cookie->getLifetime(),
            'path'     => $cookie->getPath(),
          /*  'domain'   => $cookie->getConfigDomain(),
            'secure'   => $cookie->isSecure(),
            'httponly' => $cookie->getHttponly() */

If you’ve done everything correctly, you should have your live site running on your development machine! I’m guessing reverse that process to get it to my new live server! Have Fun