How are you doing it at the moment?
I suggest you take a look at chunking
I'm wondering if Laravel query builder or eloquent supports this or not.
I am copying some very large blobs from an SQLite database to a MySQL database. The BLOBs need some conversion in PHP, and the thrown into MySQL as a geometry object.
At the moment I select the source BLOB - that's a chunk of memory. Then I convert teh BLOB (by taking off a wrapper layer it has) to another format BLOB. Then I need to push the result into a MySQL table. Each of these stages holds massive binary objects in memory and I quickly run out.
My PHP BLOB conversion works on streams, so that itself does not eat into memory. Now, is there also a way to use streams at each database end? Can I pull the BLOB from the SQLite database into a stream rather than into a variable in memory? Can I feed a stream into the MySQL column rather than passing it a massive binary object in a string?
I'm kind of looking for a big data pipeline, SQLite->PHP converter->MySQL using streams instead of memory.
Any ideas? I would like to avoid using CLI tools to export to temporay files if I can help it.
I would not store that kind of data in any database. Store it on disk instead and just have the reference to the file in the database.
Since this sounds to me like a one time thing try increasing the memory for php
Please or to participate in this conversation.