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

Import local fs files / Fix desynchronization #4265

Closed
LowieHuyghe opened this issue Dec 17, 2023 · 2 comments
Closed

Import local fs files / Fix desynchronization #4265

LowieHuyghe opened this issue Dec 17, 2023 · 2 comments

Comments

@LowieHuyghe
Copy link

LowieHuyghe commented Dec 17, 2023

Hi!

I'm setting up cozy-stack on a debian-home-server using Kubernetes (setup very similar to Docker) using the cozy/cozy-stack-image. I have been doing some testing to migrate from my current self-hosted file-manager to Cozy. Moving my files from my current file-manager to cozy-stack can be as simple as doing mv path/to/old/file-manager/* path/to/cozy-stack-data/cozy.mydomain.com/.
However, since Cozy uses a vfs, CouchDB needs to be notified of these local fs changes as well. I've done some simple testing as followed:

  1. Create a file path/to/cozy-stack-data/cozy.mydomain.com/test.txt
  2. cozy-stack check fs cozy.mydomain.com shows the following output:
root@files-cozy-0:/var/lib/cozy# cozy-stack check fs cozy.lowiehuyghe.com
{"type":"index_missing","file_doc":{"type":"file","name":"test.txt","created_at":"2023-12-17T13:59:22.129501558+01:00","updated_at":"2023-12-17T13:59:22.129501558+01:00","path":"/test.txt","size":"5","mime":"application/octet-stream","class":"files","executable":true,"is_dir":false,"is_orphan":false,"has_cycle":false},"is_file":true,"is_version":false}

So cozy-stack acknowledges the missing file, but it does not add the missing index to CouchDB. Is there any way to have cozy-stack check the local fs to add these missing indexes to CouchDB? An alternative solution to import new local fs files would be great as well. Many thanks in advance!

Note: cozy-stack fix indexes cozy.mydomain.com does not do anything for me.

@LowieHuyghe LowieHuyghe changed the title Import local files Import local files / Fix desynchronization Dec 17, 2023
@LowieHuyghe LowieHuyghe changed the title Import local files / Fix desynchronization Import local fs files / Fix desynchronization Dec 17, 2023
@nono
Copy link
Member

nono commented Dec 18, 2023

You can use https://docs.cozy.io/en/cozy-stack/cli/cozy-stack_instances_export/ and https://docs.cozy.io/en/cozy-stack/cli/cozy-stack_instances_import/. It will export/import the files, but also the other data.

@nono nono closed this as completed Dec 18, 2023
@LowieHuyghe
Copy link
Author

I'm not migrating from another cozy-instance, but from a complete other file-manager. But I did find the cozy-stack files import which will import local files in Cozy from a given directory.
Thanks for the fast reply!

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