LemmyNet / lemmy

🐀 A link aggregator and forum for the fediverse
https://join-lemmy.org
GNU Affero General Public License v3.0
13.22k stars 877 forks source link

Export & Import Community Subscriptons #3040

Closed maltfield closed 1 year ago

maltfield commented 1 year ago

This issue is a feature request to provide users a very simple way for them to:

  1. Export a list of all the communities that they're currently subscribed-to and
  2. Import a list of communities to subscribe-to

This shouldn't be a complicated feature including a file that you need to download. For better UX, I think the "export" should just be a very simple plaintext list that the user can copy & paste into an "import" field.

I would recommend:

  1. a button on the Lemmy profile page that says "copy community list" which, when clicked fills the clipboard with a CSV list of the communities (as their shorthand identifiers) that the user is subscribed-to
  2. a button on the Lemmy profile page that says import community list which, when clicked, asks the user to enter a CSV list of communities.

Why

This is useful in at least a couple cases:

  1. For veteran Lemmy users to share a list of subscriptions to a new user (eg their friend from reddit), who can -- with very few clicks -- subscribe to a large number of communities at once
  2. Users may want to create a new account that's not associated with their old account. For privacy, the only thing they'd want to copy-over is the list of subscriptions (an account "migration" would be bad here).

Reddit Equivalent

In reddit, you could go to this link:

...and then click the multireddit of your subscriptions link, which would send you to a URL with a plus-delimited list of all your subreddits. Then you could logout, login, and go to this URL in your new account. Then click "subscribe" for each of the subreddits.

This was not ideal, but it was the fastest way that I was aware-of to copy & paste subreddit subscriptions from an old account to a new account. I hope lemmy can do better.

maltfield commented 1 year ago

Please note that this is distinct from #506, as described in the Why? section above

markcellus commented 1 year ago

I know this isnt the feature you've asked for but just noting here that the use of RSS feeds helped me solve this issue.

I'm subscribing to communities in my RSS reader with Lemmy's RSS feeds. All RSS readers allow you to export all of your feeds, so this is never an issue there.

Just something to think about. The use of RSS feeds also allows you to easily follow communities on other fediverse platforms as well.

maltfield commented 1 year ago

existing workaround via @RobertSchuh

There's a bookmarklet workaround to get a list of subscribed communities, useful for if you're moving to another instance:

https://feddit.de/post/808717

bunburya commented 1 year ago

For better UX, I think the "export" should just be a very simple plaintext list that the user can copy & paste into an "import" field.

I think OPML would be a good format for this, in much the same way OPML is currently used to export RSS feeds. In fact, because you can infer a community and instance from a Lemmy RSS feed URL, you could possibly allow export to an OPML file in a format that would allow it to be imported by both Lemmy and RSS feed readers.

zachfeldman commented 1 year ago

@maltfield @dessalines @Nutomic I would be down to try to take this on! Is there a way I can assign an issue to myself?

I have a lot of experience in full stack web development in Ruby/Rails and some experience with Rust, some in back end development using SQLx as an ORM and once led a book club on https://www.zero2prod.com/index.html?country_code=US so I can at least grok the basics. Not sure what the front end is built on but I'm sure I can figure it out.

Can't guarantee a timing on delivering the feature, but I can at least take a crack at it!

I know there's the bookmarklet workaround, but I think a proper feature built into the web app would be a way to get more users able to easily do this, and to relieve some of the pressure on the main Lemmy instance.

zachfeldman commented 1 year ago

Phew, took a stab at it but it's quite a lot to do in a codebase that's new to me. Will try to return to this if I have time! https://github.com/LemmyNet/lemmy/pull/3480

CMahaff commented 1 year ago

So my first "Lemmy project" was making a wrapper around the API that does this - obviously building it into Lemmy itself is much better and more efficient - but much harder.

A couple notes from earlier users / experiences:

Thanks for taking a look at this issue - it's something I've thought about a lot myself, but don't have the time to tackle at the minute - but would be very valuable to the community at large. Lemmy is growing so fast that there is a lot of instability in the community, and making it easy to hop between instances will help a lot of people fight that instability.

Nutomic commented 1 year ago

Saved posts is another request, though that could potentially become "quite large", and I feel like there's a bigger likelihood that the new instance doesn't even know about these posts' existence, so it's potentially more problematic

Unknown posts can be fetched with resolve_object endpoint.

The tool I made copies some profile settings as well (language, sorting, etc.) - there are pros and cons to this - it makes it more convenient for moving accounts / backing up your data, but it makes it weirder for sharing as described in the issue. It's also incredibly likely that these options will continue to change with Lemmy still very much in development, so it could mean the export format changes a lot which is not ideal.

I think its fine to export this, the import function can simply skip any unknown settings.

No matter what you choose, I would include some kind of version information in the exported file so that if it ever needs to change, import can hopefully accept / convert the data, even if it's incomplete. Otherwise you could run into a situation where a user thought they had a backup, but that file is no longer compatible with any Lemmy instance for import.

The main data (subscribed community ids) is specified by Activitypub, so its not going to break. Same for blocked user/community ids. Anyway it cant hurt to include the Lemmy version in the export.

trymeouteh commented 1 year ago

This would be useful when moving to another instance, especially when your following hundreds of communities. To make a new account on another instance and to have to go and click follow for each community from your old account can take a few hours or more.

dessalines commented 1 year ago

This wouldn't be too difficult to add, it just needs someone to work on it.

zachfeldman commented 1 year ago

Yeah sorry I haven't had time to return to my PR...anyone else is welcome to pick this up. Maybe I will in the next few weeks :/.

Nutomic commented 1 year ago

https://github.com/LemmyNet/lemmy/pull/3976

zachfeldman commented 1 year ago

Way to go @Nutomic !