[英]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.