简体   繁体   English

magento从一个域迁移到另一个域

[英]magento migration from one domain to another

I am transferring my magento site from an old domain to a new domain. 我正在将magento网站从旧域转移到新域。

I have exported the database file from the old server and I have done all the necessary changes. 我已经从旧服务器中导出了数据库文件,并做了所有必要的更改。

Now I'm trying to run the exported file into the new database but sql is stuck at loading for almost an hour. 现在,我试图将导出的文件运行到新数据库中,但是sql在加载时停留了将近一个小时。

Please somebody help. 请有人帮忙。

See loading screen attached. 参见随附的加载屏幕。 Image here 图片在这里

Thank you. 谢谢。

I would suggest making a backup of the whole 'cPanel' and then reimport it back in. This way you won't mess anything up with the database. 我建议对整个“ cPanel”进行备份,然后将其重新导入。这样您就不会弄乱数据库。 If you still do need to perform exporting and reimporting back - make sure you disable the key check by adding this before and after your database. 如果仍然需要执行导出和重新导入,请确保在数据库之前和之后添加密钥检查,以禁用密钥检查。

SET foreign_key_checks = 0;
SET foreign_key_checks = 1;

And to successfully import large database you must increase the memory limit on your 'mysql' within '.ini' file. 为了成功导入大型数据库,您必须增加.ini文件中'mysql'的内存限制。

I wouldn't do it through a GUI interface. 我不会通过GUI界面执行此操作。 Do you have SSH access? 您有SSH访问权限吗? If so, here's how you can run it from Command Line which won't be limited by browser processing. 如果是这样,您可以按照以下方法从命令行运行它,而不受浏览器处理的限制。

dump: 倾倒:

mysqldump -u '<<insert user>>' -p --single-transaction --database <<database name>> > data_dump.sql

load: 加载:

 mysql -p -u '<<insert user>>' <<database name>> < data_dump.sql 

It's best to do this as the root user so you don't have any trouble. 最好以root用户身份执行此操作,这样就不会有任何麻烦。

On import, if you are getting errors that the definer is not a user, you can either create the definer user or you can run this sed command that will replace the definer in your file with the current mySQL user: 导入时,如果收到错误消息,即定义者不是用户,则可以创建定义者用户,也可以运行以下sed命令,该命令将用当前的mySQL用户替换文件中的定义者:

sed -E 's/DEFINER=`[^`]+`@`[^`]+`/DEFINER=<<new user name>>/g' data_dump.sql > cleaned_data_dump.sql

As espradley and damek132 said, combine both the answers. 正如espradley和damek132所说,将两个答案结合起来。 Disable foreign key checks, if it's not. 如果不是,请禁用外键检查。 But, mostly it's there while exporting the sql dump. 但是,大多数情况下,在导出sql转储时就在那儿。 And use the mysql command line through ssh. 并通过ssh使用mysql命令行。 You should be up and running in half an hour. 您应该在半小时内启动并运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在迁移过程中将数据从一个表复制到另一个表 - SQL Copy Data from one table to another during migration 在MySQL中将Magento属性值从一行复制到另一行 - Copy Magento attribute value from one row to another in mySQL 在SQL Server中将权限从一个域传输到另一个域 - Transfer permissions from one domain to another in SQL Server 在MVC迁移中,我无法从一种解决方案更新数据库,但可以从另一种解决方案更新数据库 - In MVC Migration, I can't update-database from one solution but can do it from another Magento:域从旧域更改为新域和托管问题 - Magento: domain change from old to new domain and hosting troubles SQL数据库迁移-性能问题(将数据从一个数据库复制到另一个数据库) - SQL Database Migration - Performance issue (Copying data from one database to another) 从另一个域登录SQL - Login SQL from another domain SQL 数据库迁移到 Salesforce/另一个 CRM(一次导入) - SQL Database Migration to Salesforce/Another CRM (One Time Import) 如何在 Laravel Migration 中从另一个表创建虚拟计算列? - How to Create a virtual calculated column in Laravel Migration from another table? 如何从电子邮件中选择@domain并使用mysql从另一个表进行匹配 - how to select @domain from email and match from another table with mysql
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM