简体   繁体   English

从cakephp应用程序将本地mysql数据库迁移到heroku postgres

[英]Migrating a local mysql database to heroku postgres from a cakephp application

Hi I'm trying to migrate a database that was created with cakePHP on a local MYSQL database. 嗨,我正尝试在本地MYSQL数据库上迁移使用cakePHP创建的数据库。 I know that in rails the solution is to install the postgres gem that will handle the migration, but I'm wondering more specifically about cakePHP. 我知道在Rails中,解决方案是安装将处理迁移的postgres gem,但我想知道的是关于cakePHP的更多具体信息。

I've generated a sqldump of the mysql database using the solution here: http://book.cakephp.org/2.0/en/console-and-shells/schema-management-and-migrations.html 我使用以下解决方案生成了mysql数据库的sqldump: http ://book.cakephp.org/2.0/en/console-and-shells/schema-management-and-migrations.html

I've also installed postgres locally onto my machine and am able to connect to my remote empty HEROKU database from the command line by using heroku pg:psql 我还在本地安装了postgres到我的机器上,并且能够使用heroku pg:psql从命令行连接到我的远程空HEROKU数据库。

However, if I run the SQL dump file directly in the console I get an error called SSL SYSCALL error: Software caused connection abort. 但是,如果直接在控制台中运行SQL转储文件,则会收到称为SSL SYSCALL error: Software caused connection abort. This apparently is because as a DEV / Free database account you are restricted from entering SQL commands directly. 这显然是因为作为DEV / Free数据库帐户,您被限制直接输入SQL命令。

So, that would suggest that I would have to go and use something like 因此,这表明我将不得不使用类似

heroku db:push localdatabase herokudatabase

But that produces the error Sequel::AdapterNotFound -> LoadError: 193: not a valid Win32 application 但这会产生错误Sequel::AdapterNotFound -> LoadError: 193: not a valid Win32 application

Any ideas how I might manage this migration, bearing in mind that as it's a CakePHP application I do not have the option of just installing a PostGres gem? 请记住,由于它是一个CakePHP应用程序,因此我不能选择仅安装PostGres gem,因此我将如何管理此迁移?

Thanks for any direction, or thoughts. 感谢您的指导或想法。

You almost certainly want to install Postgres locally on your machine, and get your database and code working correctly there. 您几乎可以肯定要在计算机上本地安装Postgres,并在那里使数据库和代码正常工作。 Once it's set up, it's easy to do a dump of your Postgres database and upload to Heroku. 设置完成后,可以很容易地转储Postgres数据库并将其上传到Heroku。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM