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

Export/Import user (aka "migrate") #2868

Closed
wants to merge 2 commits into from

Conversation

hughrun
Copy link
Contributor

@hughrun hughrun commented Jun 6, 2023

Preliminary work on an Export/Import flow for users

This is very preliminary and subject to change, potentially in major ways.

Intended to resolve #1012

Users can export a JSON file and import the file into another instance.
Uses serializers.serialize so this is just a straight Django dump, not an ActivityPub JSON format.

  • import user profile
  • import selected user settings
  • import goals
  • import books (as combined Book and Edition objects) and their authors
  • import shelves and ShelfBooks
  • import lists and ListItems
  • import reviews (as combined Review and Status objects)
  • import readthroughs
  • saved lists
  • follows
  • user blocks
  • load book images
  • flip curation on group-curating lists (see below)
  • use task manager for imports

Related future work

We will also need a way to indicate in the old instance that the user has moved. I am anticipating we'll do that in a separate PR, using a Move ActivityPub action similar to how Mastodon does it ("Alice has Moved Alice to Bob") but also possibly Moveing book lists.

Exclusions

  • I initially did not intend to migrate quotes and comments but we could do this fairly easily.
  • as Groups are not currently ActivityPub-aware objects, I have excluded them, though in future these need to be ActivityPub objects and therefore included. Not this also means we should flip any Group curated lists back to default. i.e. Groups can only exist between users who are all local users.

hughrun added 2 commits June 2, 2023 21:07
This is very preliminary work on JSON exports and imports for users to aid account migration.
The JSON file structure may change in future commits.
- import user profile
- import selected user settings
- import goals
- import books and their authors
- import shelves and ShelfBooks
- import lists and ListItems
- import readthroughs
- import reviews

TODO
- saved lists
- follows
@hughrun
Copy link
Contributor Author

hughrun commented Jun 17, 2023

Work for this is happening at https://codeberg.org/GuildAlpha/bookwyrm for now and will come back here eventually.

@mouse-reeve
Copy link
Member

thank you SO much for working on this and feel free to ping me here or on mastodon if I can answer any questions

@skobkin
Copy link
Contributor

skobkin commented Jun 21, 2023

By the way, @mouse-reeve, does bookwyrm support move activity right now? If not, it'd be good to have it with migration to be able to automatically move followers to the new instance.

@hughrun
Copy link
Contributor Author

hughrun commented Jun 22, 2023

@skobkin Not yet. My plan is to do this in 2 steps: first just enable user export/import, then add Move as a separate PR immediately following - for user ids and potentially lists. The second should be fairly straightforward once we sort out export and import, though I guess technically they don't rely on each other.

@skobkin
Copy link
Contributor

skobkin commented Jun 22, 2023

@hughrun Sounds awesome.

Sorry if it wasn't clear, but I didn't mean that it should be implemented in this PR.

@hughrun
Copy link
Contributor Author

hughrun commented Sep 5, 2023

closing this in favour of #2980

@hughrun hughrun closed this Sep 5, 2023
@hughrun hughrun deleted the exportjson branch January 14, 2024 01:11
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

Successfully merging this pull request may close these issues.

Migrate Accounts To Another Instance & Import/Export
3 participants