How can we help you today?

How to Manually Migrate Magento to Hypernode

Created by: Sophie van Vrijberghe de Coningh

Modified on: Wed, 12 Aug, 2020 at 8:54 AM


If for some kind of reason the Hypernode importer tool 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

Step 1: Login to your Hypernode using SSH.

ssh app@$NODE

Step 2: Make sure you can login to your current domain from there.

ssh $CURRENT_SSH
exit

Step 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.

Step 4: Enter /data/web/public, all subsequent steps will assume you are in it.

cd public

Step 5: Fix all broken absolute symlinks in the site. You can find them using find.

find . -type l -xtype l
modman repair

Step 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

Step 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

Step 8: Copy the database.

ssh $CURRENT_SSH "n98-magerun --root-dir=$DOMAIN db:dump --strip='@stripped' --stdout" | n98-magerun db:console

Step 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></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>

If you use Magento 1.7.x.x or lower, you will need to install the Redis extension from Collin Mollenhour. This is because older versions of Magento do not have a Redis extension included. Please read further instructions on how to install the Redis Extension.

Step 10: Check for hardcoded paths in files and fix them manually. You can find them using:

grep -r /home/users .

Step 11: Flush the cache, just to be sure.

n98-magerun cache:flush

Step 12:  Convert the apache configuration you might have done in .htaccess files to Nginx configuration, see this manual for some hints.

Step 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.

Step 14: Copy your cronjobs. More information can be found in How to Use Periodic Tasks (Cronjobs) on Hypernode.

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

S
Sophie is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.