datastore-backup
Advanced tools
Comparing version 1.0.10 to 1.0.12
@@ -1,2 +0,1 @@ | ||
export * from './lib/async'; | ||
export * from './lib/number'; | ||
export * from './lib/datastore-backup'; |
@@ -13,4 +13,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./lib/async"), exports); | ||
__exportStar(require("./lib/number"), exports); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBQUEsOENBQTRCO0FBQzVCLCtDQUE2QiJ9 | ||
__exportStar(require("./lib/datastore-backup"), exports); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBQUEseURBQXVDIn0= |
import { Datastore } from '@google-cloud/datastore'; | ||
import { Ora } from 'ora'; | ||
export declare function dumpAllKinds(datastore: Datastore, bucketName: string, backupName?: string | undefined, backupDir?: string, spinner?: Ora): Promise<string[]>; | ||
export declare function dumpAllKinds(datastore: Datastore, bucketName: string, backupName?: string, backupDir?: string, spinner?: Ora): Promise<string[]>; | ||
/** Returns a list of all Namespaces in a Datastore for the current namespace. | ||
*/ | ||
export declare function getNamespaces(datastore: Datastore): Promise<string[]>; |
@@ -30,21 +30,24 @@ "use strict"; | ||
const R = __importStar(require("ramda")); | ||
async function dumpAllKinds(datastore, bucketName, backupName = undefined, backupDir = 'bak', spinner) { | ||
async function dumpAllKinds(datastore, bucketName, backupName, backupDir = 'bak', spinner) { | ||
spinner = spinner || (0, ora_1.default)({ isSilent: true }); | ||
spinner.start(); | ||
// spinner.text = 'Loading Namespaces'; | ||
// await runNamespaceQuery(datastore); | ||
spinner.text = | ||
`Loading Kinds for ${await datastore.getProjectId()}` + | ||
(datastore.namespace ? `for namespace ${datastore.namespace}` : ''); | ||
const kindNames = await getKindNames(datastore); | ||
spinner.succeed(`${kindNames.length} Kinds`).start(); | ||
const outputUrls = []; | ||
backupName = backupName || (await getBackupDefaultName(datastore)); | ||
spinner.succeed(`backup to gs://${bucketName}/${backupDir}/${backupName}`); | ||
const outputUrls = []; | ||
for (const sublist of R.splitEvery(100, kindNames)) { | ||
spinner.start(); | ||
const { outputUrl } = await dumpKinds(datastore, sublist, bucketName, backupDir, `${backupName}-${outputUrls.length}`, spinner); | ||
outputUrls.push(outputUrl); | ||
spinner.info(`backup to gs://${bucketName}/${backupDir}/${backupName}`); | ||
spinner.info(`Dumping datastore ${await datastore.getProjectId()}` + | ||
(datastore.namespace ? `for namespace ${datastore.namespace}` : '')); | ||
try { | ||
spinner.start(`Loading Kinds`); | ||
const kindNames = await getKindNames(datastore); | ||
spinner.succeed(`${kindNames.length} Kinds`).start(); | ||
for (const sublist of R.splitEvery(100, kindNames)) { | ||
spinner.start(); | ||
const { outputUrl } = await dumpKinds(datastore, sublist, bucketName, backupDir, `${backupName}-${outputUrls.length}`, spinner); | ||
outputUrls.push(outputUrl); | ||
} | ||
spinner.start().succeed(`written ${outputUrls}`); | ||
} | ||
spinner.start().succeed(`written ${outputUrls}`); | ||
catch (error) { | ||
spinner.fail(error.message); | ||
throw error; | ||
} | ||
return outputUrls; | ||
@@ -60,3 +63,3 @@ } | ||
(await datastore.getProjectId()) + | ||
(datastore.namespace ? ':' + datastore.namespace : '')); | ||
(datastore.namespace ? `:${datastore.namespace}` : '')); | ||
} | ||
@@ -98,3 +101,3 @@ async function dumpKinds(datastore, kindNames, backupBucket, backupDir, backupName, spinner) { | ||
outputUrl: response[0].outputUrl, | ||
operation: operation, | ||
operation, | ||
result: response, | ||
@@ -119,3 +122,3 @@ }; | ||
* | ||
* Kinds where the name starts with `_` are supressed. | ||
* Kinds where the name starts with `_` are suppressed. | ||
*/ | ||
@@ -128,2 +131,2 @@ async function getKindNames(datastore) { | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YXN0b3JlLWJhY2t1cC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvZGF0YXN0b3JlLWJhY2t1cC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsZ0RBQXdCO0FBRXhCLDhDQUErQjtBQUMvQixnRUFBdUM7QUFDdkMseUNBQTJCO0FBRXBCLEtBQUssVUFBVSxZQUFZLENBQ2hDLFNBQW9CLEVBQ3BCLFVBQWtCLEVBQ2xCLGFBQWlDLFNBQVMsRUFDMUMsU0FBUyxHQUFHLEtBQUssRUFDakIsT0FBYTtJQUViLE9BQU8sR0FBRyxPQUFPLElBQUksSUFBQSxhQUFHLEVBQUMsRUFBRSxRQUFRLEVBQUUsSUFBSSxFQUFFLENBQUMsQ0FBQztJQUM3QyxPQUFPLENBQUMsS0FBSyxFQUFFLENBQUM7SUFDaEIsdUNBQXVDO0lBQ3ZDLHNDQUFzQztJQUN0QyxPQUFPLENBQUMsSUFBSTtRQUNWLHFCQUFxQixNQUFNLFNBQVMsQ0FBQyxZQUFZLEVBQUUsRUFBRTtZQUNyRCxDQUFDLFNBQVMsQ0FBQyxTQUFTLENBQUMsQ0FBQyxDQUFDLGlCQUFpQixTQUFTLENBQUMsU0FBUyxFQUFFLENBQUMsQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0lBQ3RFLE1BQU0sU0FBUyxHQUFHLE1BQU0sWUFBWSxDQUFDLFNBQVMsQ0FBQyxDQUFDO0lBQ2hELE9BQU8sQ0FBQyxPQUFPLENBQU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UMsSUFBSSxDQUFDLENBQUM7SUFDeEUsT0FBTyxVQUFVLENBQUM7QUFDcEIsQ0FBQztBQUxELHNDQUtDO0FBQ0Q7OztHQUdHO0FBQ0gsS0FBSyxVQUFVLFlBQVksQ0FBQyxTQUFvQjtJQUM5QyxNQUFNLEtBQUssR0FBRyxTQUFTLENBQUMsV0FBVyxDQUFDLFVBQVUsQ0FBQyxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsQ0FBQztJQUNsRSxNQUFNLENBQUMsUUFBUSxDQUFDLEdBQUcsTUFBTSxTQUFTLENBQUMsUUFBUSxDQUFDLEtBQUssQ0FBQyxDQUFDO0lBQ25ELE1BQU0sS0FBSyxHQUFHLFFBQVEsQ0FBQyxHQUFHLENBQUMsQ0FBQyxNQUFNLEVBQUUsRUFBRSxDQUFDLE1BQU0sQ0FBQyxTQUFTLENBQUMsR0FBRyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDbkUsT0FBTyxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxVQUFVLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQztBQUNqRCxDQUFDIn0= |
@@ -1,2 +0,1 @@ | ||
export * from './lib/async'; | ||
export * from './lib/number'; | ||
export * from './lib/datastore-backup'; |
@@ -1,3 +0,2 @@ | ||
export * from './lib/async'; | ||
export * from './lib/number'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxhQUFhLENBQUM7QUFDNUIsY0FBYyxjQUFjLENBQUMifQ== | ||
export * from './lib/datastore-backup'; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx3QkFBd0IsQ0FBQyJ9 |
import { Datastore } from '@google-cloud/datastore'; | ||
import { Ora } from 'ora'; | ||
export declare function dumpAllKinds(datastore: Datastore, bucketName: string, backupName?: string | undefined, backupDir?: string, spinner?: Ora): Promise<string[]>; | ||
export declare function dumpAllKinds(datastore: Datastore, bucketName: string, backupName?: string, backupDir?: string, spinner?: Ora): Promise<string[]>; | ||
/** Returns a list of all Namespaces in a Datastore for the current namespace. | ||
*/ | ||
export declare function getNamespaces(datastore: Datastore): Promise<string[]>; |
@@ -5,21 +5,24 @@ import path from 'path'; | ||
import * as R from 'ramda'; | ||
export async function dumpAllKinds(datastore, bucketName, backupName = undefined, backupDir = 'bak', spinner) { | ||
export async function dumpAllKinds(datastore, bucketName, backupName, backupDir = 'bak', spinner) { | ||
spinner = spinner || ora({ isSilent: true }); | ||
spinner.start(); | ||
// spinner.text = 'Loading Namespaces'; | ||
// await runNamespaceQuery(datastore); | ||
spinner.text = | ||
`Loading Kinds for ${await datastore.getProjectId()}` + | ||
(datastore.namespace ? `for namespace ${datastore.namespace}` : ''); | ||
const kindNames = await getKindNames(datastore); | ||
spinner.succeed(`${kindNames.length} Kinds`).start(); | ||
const outputUrls = []; | ||
backupName = backupName || (await getBackupDefaultName(datastore)); | ||
spinner.succeed(`backup to gs://${bucketName}/${backupDir}/${backupName}`); | ||
const outputUrls = []; | ||
for (const sublist of R.splitEvery(100, kindNames)) { | ||
spinner.start(); | ||
const { outputUrl } = await dumpKinds(datastore, sublist, bucketName, backupDir, `${backupName}-${outputUrls.length}`, spinner); | ||
outputUrls.push(outputUrl); | ||
spinner.info(`backup to gs://${bucketName}/${backupDir}/${backupName}`); | ||
spinner.info(`Dumping datastore ${await datastore.getProjectId()}` + | ||
(datastore.namespace ? `for namespace ${datastore.namespace}` : '')); | ||
try { | ||
spinner.start(`Loading Kinds`); | ||
const kindNames = await getKindNames(datastore); | ||
spinner.succeed(`${kindNames.length} Kinds`).start(); | ||
for (const sublist of R.splitEvery(100, kindNames)) { | ||
spinner.start(); | ||
const { outputUrl } = await dumpKinds(datastore, sublist, bucketName, backupDir, `${backupName}-${outputUrls.length}`, spinner); | ||
outputUrls.push(outputUrl); | ||
} | ||
spinner.start().succeed(`written ${outputUrls}`); | ||
} | ||
spinner.start().succeed(`written ${outputUrls}`); | ||
catch (error) { | ||
spinner.fail(error.message); | ||
throw error; | ||
} | ||
return outputUrls; | ||
@@ -34,3 +37,3 @@ } | ||
(await datastore.getProjectId()) + | ||
(datastore.namespace ? ':' + datastore.namespace : '')); | ||
(datastore.namespace ? `:${datastore.namespace}` : '')); | ||
} | ||
@@ -71,3 +74,3 @@ async function dumpKinds(datastore, kindNames, backupBucket, backupDir, backupName, spinner) { | ||
outputUrl: response[0].outputUrl, | ||
operation: operation, | ||
operation, | ||
result: response, | ||
@@ -91,3 +94,3 @@ }; | ||
* | ||
* Kinds where the name starts with `_` are supressed. | ||
* Kinds where the name starts with `_` are suppressed. | ||
*/ | ||
@@ -100,2 +103,2 @@ async function getKindNames(datastore) { | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YXN0b3JlLWJhY2t1cC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvZGF0YXN0b3JlLWJhY2t1cC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLElBQUksTUFBTSxNQUFNLENBQUM7QUFFeEIsT0FBTyxHQUFZLE1BQU0sS0FBSyxDQUFDO0FBQy9CLE9BQU8sV0FBVyxNQUFNLGNBQWMsQ0FBQztBQUN2QyxPQUFPLEtBQUssQ0FBQyxNQUFNLE9BQU8sQ0FBQztBQUUzQixNQU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QyxDQUFDLENBQUM7QUFDakQsQ0FBQyJ9 |
@@ -5,2 +5,11 @@ # Changelog | ||
### [1.0.12](https://github.com/mdornseif/datastore-backup/compare/v1.0.11...v1.0.12) (2022-01-20) | ||
### Bug Fixes | ||
* **doc:** Readme Badges ([1548622](https://github.com/mdornseif/datastore-backup/commit/154862225d0778fedb28224650d852a5edb8e10e)) | ||
### [1.0.11](https://github.com/mdornseif/datastore-backup/compare/v1.0.10...v1.0.11) (2022-01-20) | ||
### [1.0.10](https://github.com/mdornseif/datastore-backup/compare/v1.0.9...v1.0.10) (2021-12-23) | ||
@@ -7,0 +16,0 @@ |
{ | ||
"name": "datastore-backup", | ||
"bin": "build/main/bin/datastoreDump.js", | ||
"version": "1.0.10", | ||
"version": "1.0.12", | ||
"description": "Programatic Backup of Google Cloud Datastore", | ||
@@ -6,0 +6,0 @@ "main": "build/main/index.js", |
@@ -12,3 +12,3 @@ [![Build Status](https://img.shields.io/travis/mdornseif/datastore-backup.svg?style=flat-square&color=%23007a1f)](https://travis-ci.org/mdornseif/datastore-backup) | ||
[From the Commandline](https://cloud.google.com/sdk/gcloud/reference/datastore/export): | ||
[From the command line](https://cloud.google.com/sdk/gcloud/reference/datastore/export): | ||
@@ -55,3 +55,3 @@ ``` | ||
-n BACKUPNAME, --backupName BACKUPNAME | ||
name of backup (default: autogenerated) | ||
name of backup (default: auto-generated) | ||
-s NAMESPACE, --namespace NAMESPACE | ||
@@ -65,14 +65,14 @@ datastore namespace | ||
% export GOOGLE_APPLICATION_CREDENTIALS=~/sampleproj-b0a74af0545e.json | ||
% yarn ts-node src/bin/backup.ts sampleproj samplebucket-tmp | ||
ℹ backup to gs://hudora-tmp/bak/20211221T212651-sampleproj | ||
% yarn ts-node src/bin/backup.ts sampleproj sampleproj-tmp | ||
ℹ backup to gs://sampleproj-tmp/bak/20211221T212651-sampleproj | ||
ℹ Dumping datastore sampleproj | ||
✔ 2 Kinds | ||
2 kinds ℹ Dumping NumberingAncestor, NumberingItem | ||
2 kinds ℹ Dumping to gs://samplebucket-tmp/bak/20211221T212651-sampleproj-0 | ||
2 kinds ℹ Dumping to gs://sampleproj-tmp/bak/20211221T212651-sampleproj-0 | ||
2 kinds ✔ Dumping finished 27150 records (4.04 MB) in 51s | ||
2 kinds ✔ written gs://samplebucket-tmp/bak/20211221T212651-sampleproj-0/20211221T212651-sampleproj-0.overall_export_metadata | ||
2 kinds ✔ written gs://sampleproj-tmp/bak/20211221T212651-sampleproj-0/20211221T212651-sampleproj-0.overall_export_metadata | ||
✨ Done in 54.16s. | ||
``` | ||
This generates a single folder structure under `gs://samplebucket-tmp/bak/20211221T212651-sampleproj-0`. For projects with more than 100 entities more folders will be generated. | ||
This generates a single folder structure under `gs://sampleproj-tmp/bak/20211221T212651-sampleproj-0`. For projects with more than 100 entities more folders will be generated. | ||
@@ -87,3 +87,3 @@ There is one subfolder per kind containing the Entities encoded in [LevelDB Format](https://github.com/google/leveldb). | ||
await dumpAllKinds(new Datastore({ projectId: 'sampleproj' }), 'samplebucket-tmp') | ||
await dumpAllKinds(new Datastore({ projectId: 'sampleproj' }), 'sampleproj-tmp') | ||
``` | ||
@@ -90,0 +90,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
43442
16
344
1