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?
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 !
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")
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 :
Hope it helps !
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:
By following these steps, you should be able to migrate your Magento data and database successfully.