Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

add backup.ts, restore.ts files to dump and restore mongodb #413

Open
machi1990 opened this issue May 4, 2020 · 5 comments
Open

add backup.ts, restore.ts files to dump and restore mongodb #413

machi1990 opened this issue May 4, 2020 · 5 comments

Comments

@machi1990
Copy link

machi1990 commented May 4, 2020

Feature Request

Current, OVP https://github.com/aerogear/OpenVolunteerPlatform/blob/master/platform/server/src/db.ts is doing multiple functionalities of backing up the db and restoring it by default.

Is your feature request related to a problem? Please describe.

  • Doing backup is tedious and involves loads of manual work
  • Not that much of a problem but doing data restoring each time when there is no need slow the boot time, where at this phase we just need to establish a connection to mongodb.

Describe the solution you'd like

Maybe we can split this into two parts:

  • a backup.ts file which will do the dumping process
  • a restore.ts file which will do the restoring process
  • a connect.ts file which just creates a db connection (this can be the the db.ts file)

The first two files can lead to scripts in package.json

{
  "scripts": {
     .....
    "backup": "ts-node server/backup.ts",
    "restore": "ts-node server/restore.ts"
     }
}

Describe alternatives you've considered
Right now If we want to do backup, we just have to uncomment the backup part in db.ts, without forgetting to comment it back to avoid backing up the data each time.

@wtrocki
Copy link
Contributor

wtrocki commented May 4, 2020

@machi1990 that will be perfect issue for DataSync starter

@machi1990
Copy link
Author

Makes sense, let me transfer the issue there?

@machi1990 machi1990 transferred this issue from aerogear/OpenVolunteerPlatform May 4, 2020
@machi1990 machi1990 changed the title split server/db.ts into backup.ts, restore.ts and connect.ts files add backup.ts, restore.ts files to dump and restore mongodb May 4, 2020
@wtrocki
Copy link
Contributor

wtrocki commented May 4, 2020

Actually this is only valid for this app as we have initial data.

@wtrocki
Copy link
Contributor

wtrocki commented May 4, 2020

Changed my mind. Data dump restore feature could be improved

@machi1990
Copy link
Author

Yes, we have it only for the OVP app but seems to me like a typical use case so having dumping and restore features at least as commands could do it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants