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

Webinterface Backup Export/Import #79

Open
therealschimmi opened this issue Jun 1, 2020 · 16 comments
Open

Webinterface Backup Export/Import #79

therealschimmi opened this issue Jun 1, 2020 · 16 comments
Labels
enhancement New feature or request WIP This is currently being worked on

Comments

@therealschimmi
Copy link

Can you include some option to export all recipes or even everything into one zip file?

@vabene1111 vabene1111 added the question Further information is requested label Jun 1, 2020
@vabene1111
Copy link
Collaborator

vabene1111 commented Jun 1, 2020

in what format would you like such a feature ?

right now you can easily export the whole database using pg_dump or alternativley by creating django fixtures python manage.py dumpdata cookbook. Both of these options are nice to create backups but are probably of not much use if you want to import into any other kind of recipe manager. I would really love to have compatability with other managers but that sadly isn't an easy task to do (see #19)

@therealschimmi
Copy link
Author

I dont care about compatibility too much. I would just like to have a backup in case i screw up something with Docker and lose all content. Just make it accessible from the webinterface :)

@vabene1111
Copy link
Collaborator

Ok, a web based backup interface it is! I think this can and will be done but it proably wont be the biggest priority since there are many good options that already work pretty well on the command line.

In the meantime you can try this script i personally use for my backups https://github.com/vabene1111/DockerPostgresBackups but be aware that its not really polished/edge case proof

@vabene1111 vabene1111 added enhancement New feature or request and removed question Further information is requested labels Jun 2, 2020
@vabene1111 vabene1111 changed the title Backup/Batch export Webinterface Backup Export/Import Jun 2, 2020
@vabene1111 vabene1111 added this to the 0.9 milestone Jun 11, 2020
@vabene1111
Copy link
Collaborator

maybe https://github.com/django-dbbackup/django-dbbackup can be used in combination with #103 and a custom interface to configure/download/restore

@vabene1111
Copy link
Collaborator

while django-dbbackup in combination with https://github.com/timonweb/django-dbbackup-ui looks really good it appears to be full of bugs where people are having all kinds of problems different databases, special characters in the DB and storage backends.

Need to find a better solution as reliability is the number one priority when it comes to backups ...

@vabene1111
Copy link
Collaborator

vabene1111 commented Jul 15, 2020

ok so i have decided to implement backups using djangos dumpdata and loaddata commands.

  • include mediafiles in backup
  • compress backup
  • non super user visibility
  • restore database
  • restore media files
  • do not export or warn sensitive data (data source secrets & session keys)
  • validate users are exported

@vabene1111 vabene1111 added the WIP This is currently being worked on label Jul 15, 2020
@vabene1111 vabene1111 removed this from the 0.12 milestone Feb 15, 2021
@koch17 koch17 mentioned this issue Aug 30, 2021
@thickconfusion
Copy link

Just wanted to drop by and say this thread was helpful for the following:
I just migrated Tandoor from an armv71 docker host to an arm64 docker host. In general it's easy to move bind and volume mounts by carefully stopping the containers, gzipping their volumes, moving to the new host, and firing back up.

However, encountered a strange issue. Because of the architecture change, Postgre (db_recipes) was giving me a strange error:

FATAL:  database files are incompatible with server
DETAIL:  The database cluster was initialized without USE_FLOAT8_BYVAL but the server was compiled with USE_FLOAT8_BYVAL.
HINT:  It looks like you need to recompile or initdb.
LOG:  database system is shut down

So I ended up using a form of this https://github.com/vabene1111/DockerPostgresBackups to create a dump, then restore it on the new machine. Voila!

@vabene1111
Copy link
Collaborator

awesome, database migration is always easiest with dumps because it is independet of the version and environment and even if it is you can just change text to get it working. Glad it helped

@mikhail5555
Copy link
Contributor

Sorry for bumping this old issue, but would a python manage.py dumpdata followed by a python manage.py loaddata work when you want to migrate from a sqlite database to a postgresql database (or is there better approach)?

@vabene1111
Copy link
Collaborator

that is likely one of the best appraoches but make sure to properly test it before deleting the old DB. There are several foreign relations across the database and loaddata might have a hard time handeling those.

I know there is an old discussion from someone who did exactly what you are planning to do, maybe that helps you.

@mikhail5555
Copy link
Contributor

that is likely one of the best appraoches but make sure to properly test it before deleting the old DB. There are several foreign relations across the database and loaddata might have a hard time handeling those.

I know there is an old discussion from someone who did exactly what you are planning to do, maybe that helps you.

Thanks, i will attempt to find that discussion, i guess i must have missed it. I will also make a small write up once I (successfully) do so, so hopefully other people would also be able to do it.

@Szeraax
Copy link
Contributor

Szeraax commented Sep 21, 2022

I just successfully exported all my recipes to a zip file via web interface and was able to import them. Is there still any work to be done on this issue? Or are we good to close it?

@vabene1111
Copy link
Collaborator

yes, the recipes are not a real backup because there are supermarkets, food metadata, autoamtions an much more that should also be included in a real backup. This is planned at some point

@gruhland
Copy link

gruhland commented Nov 7, 2023

Sorry to add a new comment to this thread. I just updated my docker installation. Then I tried to export ALL recipes. The information window shows the progress of the export but I get no automatic download. The text on the page shows immediately "If download did not start automatically: Herunterladen (Expired)" where download (Herunterladen) is crossed out. If I try to export only one recipe it is no problem. Any idea?
Regards
Goetz

@smilerz
Copy link
Collaborator

smilerz commented Nov 7, 2023

Sorry to add a new comment to this thread. I just updated my docker installation. Then I tried to export ALL recipes. The information window shows the progress of the export but I get no automatic download. The text on the page shows immediately "If download did not start automatically: Herunterladen (Expired)" where download (Herunterladen) is crossed out. If I try to export only one recipe it is no problem. Any idea? Regards Goetz

it should be fixed in the next release - in the meantime, if you hit refresh it will frequently start the download.

@gruhland
Copy link

gruhland commented Nov 7, 2023

Thanks, I will try :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request WIP This is currently being worked on
Projects
None yet
Development

No branches or pull requests

7 participants