Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: restore from backup available from installer UI #4534

Open
raulrpearson opened this issue Mar 9, 2024 · 1 comment
Open

Comments

@raulrpearson
Copy link

I sometimes start a new Pocketbase instance with the intention of duplicating an existing instance.

I currently run the installer with a dummy admin user and pass and then restore from the backup menu. I think this might be a common flow for some folks.

It'd be more convenient to be able to upload and restore from a backup file directly from the installer UI, to avoid having to create this dummy admin user first.

Thanks for this great piece of software!

@Fruup
Copy link

Fruup commented May 19, 2024

Maybe even go as far as specifying a backup to load initially (i.e. pocketbase serve --initial-backup=init.zip). This way, no manual steps have to be done.


There is a method app.restoreBackup that can be executed in hooks, but it accepts a context object as the first parameter, which I don't know what to put into. Have not gotten that to work yet.

// a file somewhere in pb_hooks/

/// <reference path="../pb_data/types.d.ts"/>
onAfterBootstrap((e) => {
  e.app.restoreBackup(context, 'init.zip')
})

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

No branches or pull requests

2 participants