A Firestore Export/Import Library and CLI
npm install @tiveor/firexim
const { firexim } = require('@tiveor/firexim')
const firexim = new Firexim([
'serviceAccountExport.json',
'serviceAccountImport.json'
])firexim
.exportCollectionToFile('collectionName', './path/to/file.json')
.then(() => {
console.log('collectionName exported to file.json')
})
.catch(e => {
console.log(e)
})firexim
.importCollectionFromFile('collectionName', './path/to/file.json')
.then(() => {
console.log('collectionName exported to file.json')
})
.catch(e => {
console.log(e)
})firexim
.importCollection('fromCollectionName', 'toCollectionName')
.then(() => {
console.log('Exported and Imported successfully')
})
.catch(e => {
console.log(e)
})npm install -g @tiveor/firexim
firexim names --config="config/serviceAccount.json"firexim exp --fromConfig="config/serviceAccount.json" --fromCollection="collectionName" --toFile="output/collectionName.json"firexim imp --toConfig="config/serviceAccount.json" --toCollection="collectionName" --fromFile="input/collectionName.json"firexim expimp --fromConfig="config/serviceAccountExport.json" --fromCollection="collectionName" --toConfig="config/serviceAccountImport.json" --toCollection="collectionName"