I exported my Firestore database using firestore-export
and wrote it to a json
file.
I had to read this thread in order to get the data written to the file properly. I decided to increase the memory space with this command:
export NODE_OPTIONS="--max-old-space-size=16384"
I also updated to node version 16, it was recommended to update to the latest version.
$ node --version
v16.2.0
When I tried to import that file to another database instance for redundancy, it did not work.
firestore-import -a admin-sdk-key.json -b export.json
Only some of the data was written and the operation aborted. The full error output is on Pastebin linked here:
A lot of the errors looked like this
Caused by: Error
at WriteBatch.commit (/usr/local/lib/node_modules/node-firestore-import-export/node_modules/@google-cloud/firestore/build/src/write-batch.js:415:23)
at /usr/local/lib/node_modules/node-firestore-import-export/dist/lib/import.js:67:22
at Array.map (<anonymous>)
at setDocuments (/usr/local/lib/node_modules/node-firestore-import-export/dist/lib/import.js:52:34)
at Object.importData [as firestoreImport] (/usr/local/lib/node_modules/node-firestore-import-export/dist/lib/import.js:26:41)
at /usr/local/lib/node_modules/node-firestore-import-export/dist/bin/firestore-import.js:77:17
at Generator.next (<anonymous>)
at fulfilled (/usr/local/lib/node_modules/node-firestore-import-export/dist/bin/firestore-import.js:6:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
code: 13,
details: 'Received RST_STREAM with code 2',
metadata: Metadata { internalRepr: Map(0) {}, options: {} },
note: 'Exception occurred in retry method that was not classified as transient'
}