Manually migrate Magento to Hypernode

in Migration Tags: MagentoMigrationMySQLService panelSSH

If for some kind of reason the importer-script doesn’t work for you (you might use a module that the importer-script isn’t compatible with) you can also migrate your site to Hypernode manually. Follow the next steps to manually migrate Magento to Hypernode.

NB: If you set some environment variables, you can follow along these instructions by copy-pasting most of the commands in this document to the command line. E.g.:

NODE=name.hypernode.io
DOMAIN=domainname.nl
CURRENT_SSH=$DOMAIN@ssh12345.bytenet.nl
  1. Login to your Hypernode using SSH.
    ssh app@$NODE
    
  2. Make sure you can login to your current domain from there.
    ssh $CURRENT_SSH
    exit
    
  3. Synchronize all files to the hypernode using rsync
    rsync -a --exclude=/var/\*/\* --delete $CURRENT_SSH:$DOMAIN/ /data/web/public
    

    For subsequent runs, you can prevent your xml files from being overwritten by adding --exclude=\*.xml . If you’re using Extendware modules, make sure you don’t exclude the var/extendware folder.

  4. Enter /data/web/public, all subsequent steps will assume you are in it.
    cd public
    
  5. Fix all broken absolute symlinks in the site. You can find them using find:
    find . -type l -xtype l
    modman repair
    
  6. Change the database host in the local configuration to use the hypernode database server, called ‘mysqlmaster’:
    sed -i "s/$(n98-magerun db:info host)/mysqlmaster/" app/etc/local.xml
    
  7. Create the local database user
    DBUSER=$(n98-magerun db:info username)
    DBPASS=$(n98-magerun db:info password)
    DBNAME=$(n98-magerun db:info dbname)
    
    echo "CREATE DATABASE $DBNAME" | mysql
    echo "GRANT ALL PRIVILEGES ON $DBNAME.* TO '$DBUSER'@'%' IDENTIFIED BY '$DBPASS'" | mysql
    
  8. Copy the database:
    ssh $CURRENT_SSH "n98-magerun --root-dir=$DOMAIN db:dump --strip='@stripped' --stdout" | n98-magerun db:console
    
  9. Remove memcache configuration from app/etc/local.xml and fix redis configuration in app/etc/local.xml and app/etc/fpc.xml.In app/etc/local.xml the cache configuration should look like this:
    <cache>
        <backend>Cm_Cache_Backend_Redis</backend>
        <backend_options>
            <server>redismaster</server>
            <port>6379</port>
            <persistent></persistent>    
            <database>0</database>
            <password></password>
            <force_standalone>0</force_standalone>  
            <connect_retries>1</connect_retries>    
            <read_timeout>10</read_timeout>        
            <automatic_cleaning_factor>0</automatic_cleaning_factor>
            <compress_data>1</compress_data>  
            <compress_tags>1</compress_tags>      
            <compress_threshold>20480</compress_threshold>      
            <compression_lib>gzip</compression_lib>
        </backend_options>
    </cache>
    

    And if you have FPC configured, app/etc/fpc.xml should look like this:

    <fpc>
        <lifetime>86400</lifetime>
        <backend>Cm_Cache_Backend_Redis</backend>
        <backend_options>
            <server>redismaster</server>
            <port>6379</port>
            <persistent>cache-fpc</persistent>
            <database>1</database>
            <password></password>
            <force_standalone>0</force_standalone>
            <connect_retries>1</connect_retries>
            <lifetimelimit>86400</lifetimelimit>
            <read_timeout>10</read_timeout>
            <compress_data>1</compress_data>
            <compress_tags>1</compress_tags>
            <compress_data>gzip</compress_data>
        </backend_options>
    </fpc>
    
  10. Check for hardcoded paths in files and fix them manually. You can find them using:
    grep -r /home/users .
    
  11. Flush cache, just to be sure 🙂
    n98-magerun cache:flush
    
  12. Convert the apache configuration you might have done in .htaccess-files to nginx configuration, see this manual for some hints.
  13. Test your site by creating one or more DNS CNAME records to your hypernode and configuring base urls for them, or by temporarily adding entries to your local hosts file.
  14. Copy your cronjobs. More information can be found in Configure cronjobs on Hypernode.

Done? Now it’s time to check if everything works as it should!

0