从本地 Sqlite3 转储并导入 Heroku 生产服务器

Dump from Local Sqlite3 and Import in Heroku Production Server

我在 Heroku 上安装了 Django 应用程序。

我的本地开发服务器是 运行 带有 Sqlite 的 django,其中包含我想传输到 Heroku Postgre 的大量数据(几个演出)。

Heroku 提供了 this import/export 指南,让我们从本地 POSTGRE 数据库中导出一个文件,创建一个转储文件并将其导入 (pg:restore) 到 Prod 上。 heroku DB.

如何从我的 Sqlite 数据库生成转储文件并导入到 Heroku Postgre 中?

它没有直接回答你的问题,但我建议不要在开发和生产中使用不同的数据库。考虑阅读这个很棒的 article describing methodologies for developing apps for cloud deployment and especially this page.

我结束了在开发服务器上迁移到 Postgre SQl。下面的 link 让我更轻松地将数据从 Sqlite3 移动到 Postgre。

https://racingtadpole.com/blog/django-fixtures-to-copy-database/

之后,我将 pg-backup 创建一个转储文件并填充 heroku 数据库。