How can I migrate my data from my rails app from mySql to SQLite?
Is this possible?
The quickest and easiest way to convert SQLite to MySQL is by exporting an SQL Database to a Dump File, and then importing the SQLite Dump into MySQL Database. You can export an SQLite Database to Dump File using the . dump command.
To use the Rails 6 db system change command, you simply need to specify the new database adapter with the --to option. Keep in mind, you may need to change the version numbers of the database adapter in your Gemfile after running this command.
Rails defaults to using a SQLite database when creating a new project, but you can always change it later.
Great question!
In the past I had to migrate Gb of databases from SQlite to MySQL to PostgreSQl and viceversa. I tried tons of utilities, scripts and tools but the only way I found to successfully migrate the database was to export the data into a database-free schema, then import the data.
This plugin saved my life thousands of times: yaml_db.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With