cancel
Showing results for 
Search instead for 
Did you mean: 

Migration Magento 1.9.x from a server to another

SOLVED

Migration Magento 1.9.x from a server to another

Hi,

could anybody tell me if the following procedure is correct?

 

*/ Copy all files and DB from OLD server to NEW server

*/ Change the DB data ( name, user and password ) into the config file ( Where and which is ?)

*/ Change the host ip somewhere into the NEW db ( which is the correct voice ?)

 

And everything should work normal, isn't it?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Migration Magento 1.9.x from a server to another

Hello @lucablue

1. Yes, Compress all files in the root of your Magento. You can use the transfer script. Make a php file in new server with name transfer.php and place the code like below.

<?php exec("wget http://domain.com/files.zip"); ?>

This will transfer your files from one server to another.

2. Same for database, if you can export it using command.

<?php exec("wget http://domain/database.sql"); ?>

3. If you don't have access to commands, open phpmyadmin, select the database > Export > custom > Disable all foreign key checks > Go

4. Upload that too new server by making new database and import.

5.Configure the new database details in app/code/local.xml

6. Change the urls in database in new database by going at core_config_data table

7. Clear the cache from var folder

That's it.

 

 

 

 

View solution in original post

7 REPLIES 7

Re: Migration Magento 1.9.x from a server to another

Hi @lucablue,

 

Basically those are the steps yuo need to follow.

Here you'll find a highly detailed guide: https://magento2.atlassian.net/wiki/spaces/m1wiki/pages/14024841/Moving+Magento+to+Another+Server

Re: Migration Magento 1.9.x from a server to another

Hello @lucablue

1. Yes, Compress all files in the root of your Magento. You can use the transfer script. Make a php file in new server with name transfer.php and place the code like below.

<?php exec("wget http://domain.com/files.zip"); ?>

This will transfer your files from one server to another.

2. Same for database, if you can export it using command.

<?php exec("wget http://domain/database.sql"); ?>

3. If you don't have access to commands, open phpmyadmin, select the database > Export > custom > Disable all foreign key checks > Go

4. Upload that too new server by making new database and import.

5.Configure the new database details in app/code/local.xml

6. Change the urls in database in new database by going at core_config_data table

7. Clear the cache from var folder

That's it.

 

 

 

 

Re: Migration Magento 1.9.x from a server to another

Hello @lucablue,

 

The DB config data need to be changed into: 

app/etc/local.xml

In DB first you need to make sure your domain name is set correct:

# In table
`core_config_data`

# Search in column
path

# for the following  values
web/unsecure/base_url
web/secure/base_url

# and make sure they are reflecting your domain
http://www.example.com
https://www.example.com

Very important: you need to clean the cache and reindex data, the cache can be done in 2 ways, from Magento backend: 

/** For cache */ 
# Select all and refresh from the following page
System > Cache Management

Or by deleting everything from from the following folders (this works only if you don't use Redis to store the cache and the session):

var/cache/*
var/session/*

As for Reindexing, important especially if you have flat tables enabled, is done from Magento backend:

/** Reindex */
# Select and reindex 
System > Index Management 

You mentioned changing IPs, I assume you're refering to Developer Allowed IPs which indeed can be changed from DB in table core_config_data where you search for 

dev/restrict/allow_ips

in column path.

This also can be changed from Magento backend: 

System > Configuration > Developer > Developer Client Restrictions 

Re: Migration Magento 1.9.x from a server to another

Assuming your old server is A and the new one is B. The process is:

Step 1: Copy code from server A to server B

Step 2: Export database from server A

Step 3: Create a new database on server B and import database file of server A to this new database

Step 4: Pointing your domain's Ip to server B's IP address

<< Snipped >>

Re: Migration Magento 1.9.x from a server to another

Thank you all for answer!

In these days I'll do the migration and I can say if everything went good.

 

Thank you again

Re: Migration Magento 1.9.x from a server to another

Thanks for the help

Re: Migration Magento 1.9.x from a server to another

My notes have me issuing the following command in order to get the Migration to a different server to work.  This is related to your "Disable Foreign Key Checks" command above.

SET FOREIGN_KEY_CHECKS=0;
UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;