cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.3.5-p1 (Host A) to Magento 2.3.7 (Host B)

Magento 2.3.5-p1 (Host A) to Magento 2.3.7 (Host B)

I currently have a Magento 2.3.5-p1 installation on host A. I need to move the data ( /app/* & database) to a new/clean Magento 2.3.7 installation on host B. I'm having a difficult time figuring out how to get the database form host A to host B. Running into constant errors when trying to import the database on host B via command line or PHPmyadmin.

 

What is the best approach under this scenario?

4 REPLIES 4

Re: Magento 2.3.5-p1 (Host A) to Magento 2.3.7 (Host B)

Hello @aglasser1 ,

You didn't share the steps you used to export and import and what error you faced ?

please find below method to export from your old server : 

Navigate to any folder and run this command :
mysqldump -u YourUser -p YourDatabaseName > wantedsqlfile.sql

Move the wantedsqlfile.sql to your new server :

Run below commands in new server where your sql file is placed  :

mysql -u user -p
(Enter password)
create database YOUR_NEW_DATABASE_NAME;
use YOUR_NEW_DATABASE_NAME;
source wantedsqlfile.sql;

and then update your app/etc/env.php with new db details (username, password, db-name).

 

Hope it helps !

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: Magento 2.3.5-p1 (Host A) to Magento 2.3.7 (Host B)

@gaurav_harsh1 


On host A I did:

mysqldump -u dbusername -p dbname > host_a_dump.sql

On host B I did:

mysql -u newdbusername -p newdbname < host_a_dump.sql

Error was:

Can't create table `newdbname`.`soft_catalog_product_bundle_price_index` (errno: 121 "Duplicate key on write or update")

Re: Magento 2.3.5-p1 (Host A) to Magento 2.3.7 (Host B)

Hello @aglasser1 ,

 

It looks like some tables are modified in the new version, check first that which foreign key of which table it's referring to !

Looks like you have two CONTRAINTS on different tables with the same name.

Check this issue once : 

https://magento.stackexchange.com/questions/264581/foreign-key-constraint-is-incorrectly-formed-afte...

 

Hope it helps !

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: Magento 2.3.5-p1 (Host A) to Magento 2.3.7 (Host B)

To move your Magento 2.3.5-p1 data and database to a clean Magento 2.3.7 installation on a new host, follow these steps:

  1. Set up a clean Magento 2.3.7 on Host B.
  2. Create a backup of the Magento 2.3.5-p1 database on Host A.
  3. Transfer the backup file to Host B.
  4. Create a new database on Host B.
  5. Import the database backup into the new database on Host B.
  6. Update the app/etc/env.php file in Magento 2.3.7 on Host B with the new database details.
  7. Clear cache and reindex Magento on Host B.
  8. Configure any additional settings or extensions on Host B.

By following these steps, you should be able to migrate your Magento data and database successfully.