this post was submitted on 19 Nov 2024
55 points (86.7% liked)

Selfhosted

40438 readers
446 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

For a long time I've used OneDrive to sync all of my files and keep them safe, but I've been really getting into self hosting all my own services, so today I set up NextCloud to replace it. I told it to sync my OneDrive folder, and it did it's best. It copied the file structure and had all the directories and everything but emptied every folder, it deleted every single file I had on my OneDrive, now all I have is empty folders.

Luckily OneDrive has a file recovery system where I can give it a time and date to revert back to so my data should all be safe, but why on earth did it do that in the first place? This was incredibly stressful and terrifying I thought I lost all my work. What did I do wrong?

Edit: I’ve identified the issue and have learned from this experience, it is now a non issue and was completely my own doing. Wary reader, learn from my cautionary tale

Comment that helped me figure it out https://lemmy.ca/comment/12912420

all 20 comments
sorted by: hot top controversial new old
[–] [email protected] 54 points 1 week ago (2 children)

When you say "I told it to sync my one drive folder, and it did it's best" did you install nextcloud desktop and point it at the same folder that was currently syncing onedrive?

If yes, never do this. You should never layer two sync services that support virtual files over the same folder. The best way migrate to nextcloud is to use the nextcloud apps that connect to one drive and help you migrate.

Failing that the correct way would be to either set onedrive and nextcloud to sync 2 Seperate folders then copy from the onedrive folder to the nextcloud folder. Or set one drive to download all files, disable it entirely, then install nextcloud syncing with the formerly one drive folder.

[–] bpt11 25 points 1 week ago (1 children)

Yep I sure did the thing you said not to do. I’m very new to a lot of this stuff still learning, I didn’t think about it and thought it would just work in was able to recover all my files and everything is fine so I’m not worried about it anymore and I understand the issue now. So this has just been a learning experience, I’m moving on with the second message you suggested and just making a new folder and copying stuff over. Thanks for the input man

[–] [email protected] 9 points 1 week ago (1 children)

You welcome. The more you make mistakes the more you learn, just remember backups backups backups and you should be fine.

[–] [email protected] 1 points 1 week ago

@EmoPolarbear @bpt11

Backuos backups AND RESTORE. Seriously, test your backups.

[–] 9488fcea02a9 16 points 1 week ago

I feel like what you described should be a big fat warning on the nextcloud page

OP is a lot more gracious than most internet users by accepting some responsibility. But i wouldnt blame them. I might have done the same, and i've been self hosting nextcloud for 8 years now.

[–] [email protected] 14 points 1 week ago* (last edited 1 week ago) (3 children)

Wary reader, learn from my cautionary tale

I'm not sure what to learn exactly. I don't get what went wrong or why, just that the files hit deleted somehow...

[–] [email protected] 6 points 1 week ago

I’m not sure what to learn exactly

That you should keep backups :P

[–] bpt11 3 points 1 week ago (1 children)

My answer was from @[email protected], who said pointig two different services that can provide digital files to the same folder is never a good idea. Even though I turned off OneDrive which I thought would avoid anything going wrong, it was still pretty bad, so just don’t do it in the first place. Probably read their whole comment though to make sure you understand fully

[–] [email protected] 5 points 1 week ago

Can you put the relevant comment link in the OP?

[–] [email protected] 7 points 1 week ago (1 children)

Nextcloud did this to me in the exact same situation you described. Setting up a next cloud folder on the OneDrive folder. You can’t have them running at the same time. This was on windows.

I’ve since gotten rid of OneDrive and moved to Linux and never had this issue.

[–] [email protected] 3 points 1 week ago

You can run into this issue with any two sync programs that operate on virtual files, as another commenter said. This isn’t specifically a OneDrive or NextCloud problem. You can safely run both at the same time on the same machine, as long as they are syncing entirely separate directories.

That being said, this is obscure enough that I feel like there should be some kind of check in these clients to make sure they’re not about to interfere with each other - users aren’t gonna know to check for this, especially since these clients are hiding what they’re actually doing behind the scenes!

[–] [email protected] 7 points 1 week ago (1 children)

The best place to find answersaboutt nextcloud are the NC forums. And hekp if you explain more about what you did and explain your system installation.

[–] [email protected] 1 points 1 week ago

*answers about

[–] [email protected] 7 points 1 week ago (1 children)

I don't use the desktop app, but the mobile app has a setting for what to do with the original file:

  1. Keep in original folder
  2. Move to app folder
  3. Deleted

I have different sync folders setup differently depending on use case, but I typically use option #1 as my "default".

Maybe when you setup the sync folder, you set it to delete the local files?

Also, is the OneDrive folder a "real" folder or virtual one? I've only used Google Drive for things like that, and the local folder just holds a skeleton of the contents and pulls from the network on-demand. It...does not play well with other sync utilities or even copying through robocopy.

[–] [email protected] 2 points 1 week ago

OneDrive uses virtual files and there is an open bug that isn't getting enough attention

https://feddit.it/comment/10231887

[–] [email protected] 7 points 1 week ago* (last edited 1 week ago)

it is now a non issue

IMHO it's still a big issue that might lead to data loss to someone else. The Windows client should be hardcoded to refuse syncing in onedrive folder.

~~Someone should reproduce this in a VM and open a GitHub issue~~

Edit: they already know this since a couple years, and the same happens on MacOS https://github.com/nextcloud/desktop/issues/4276

[–] [email protected] 6 points 1 week ago

Because you pointed 2 programs at the same directory to sync the content with an external directory structure.

In my experience adding an already existing directory structure to a sync program is a bad idea. Create the directory and then move the existing structure into it to be safe or/and at the very least have a backup.

Not having a backup is on you. You got lucky this time.

[–] [email protected] 4 points 1 week ago (1 children)

The title is a little click baity which will lead to armies of people commenting about how much the dislike Nextcloud. You might want to specify the Nextcloud client.

Anyway this seems like very problematic behavior. Maybe there was a setting somewhere? Nextcloud client should not delete files. It is possible that there was some sort of conflict with Onedrive. This is why it is important to have backups.

[–] [email protected] 1 points 1 week ago

It appears to be a known bug, not a setting

https://feddit.it/comment/10231887