Migrating Magento to another server

Migrating the Magento platform to another server is relatively a simple task. I have detailed the steps below:

  1. From the admin, go to Configuration -> Web -> and change the (Unsecure and Secure) fields to {{base_url}}.
  2. From the admin, go to System -> Tools -> Backups and click on the backup button. This will create a backup of your database.
  3. Make a copy your Magento root.
  4. Move all data over to the new server.
  5. Restore the database on the new host.
  6. If you have a different username, password or database name. You’ll need to update that as well. You can find the file in (‘magento_root/app/etc/local.xml’) and make the required changes.
  7. Navigate to your Magento root, and delete all of the files and folders in, (i.e. /var/www/magento/var) except for the .htaccess file.

Hope this helps someone :)

Tags: ,

9 Responses to “Migrating Magento to another server”

  1. Ben Maden

    Thanks Richard
    Concise and to the point which helped me get the job done just a little bit faster :)

  2. Richard

    @Ben, Thanks!

  3. hucks

    im not sure i dare to change the adress, last time i changed something in web i lost all acess to my store. and has to make new store, took me 3 weeks , make it all work again change language, mails new products etc. so can you verify its secure to do this, and tell me if i have understand right what i have to do ?

    here is my settings before/ after (i havent actual changed anything yet, only on the paper)

    actual settings.
    Unsecure
    Rod URL http://dahlsvarehus.com/magento/
    Base link-URL {{unsecure_base_url}}
    Base skin-URL {{unsecure_base_url}}skin/
    Base medie-URL {{unsecure_base_url}}media/
    Base JavaScript-URL {{unsecure_base_url}}js/
    Secure
    Rod URL http://dahlsvarehus.com/magento/
    Base link-URL {{secure_base_url}}
    Base skin-URL {{secure_base_url}}skin/
    Base medie-URL {{secure_base_url}}media/
    Base JavaScript-URL {{secure_base_url}}js/
    —-
    New Settings.
    Unsecure
    Rod URL {{base_url}}
    Base link-URL {{base_url}}
    Base skin-URL {{base_url}}
    Base medie-URL {{base_url}}
    Base JavaScript-URL {{base_url}}
    Secure
    Rod URL {{base_url}}
    Base link-URL {{base_url}}
    Base skin-URL {{base_url}}
    Base medie-URL {{base_url}}
    Base JavaScript-URL {{base_url}}

    and i will first be in a month or two i change server,
    so do i have to change settings back . or do my site works with all set to {{base_url}}
    looks strange that i¨t can work if the urls is changed,

    best regards hucks.

  4. ole dahl

    ??? deleted and no reply, have i done anything wrong ???

  5. ole dahl

    never mind i let my new host moove my shop :)

  6. Spenser

    I’m attempting all this again right now. My first attempt went horribly wrong…

  7. Richard

    @hucks,

    That should work.

  8. Fransnico

    This post is works. I just want to add one thing.
    If you migrate from from localhost or from other domain don’t forget to change it in your sql database. If you don’t the links will point to your old domain.
    To do it, just open your sql dump using any text editor. Find your old domain and replace it with your new domain. e.g (http://localhost/magento/) to (http://yournewdomain.com/).
    Now you can import the sql dump to your new database.

  9. Richard

    @Fransnico, Thanks ;)

Leave a Reply