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

User id conflict when importing from the command line #392

Closed
prairietree opened this issue Apr 8, 2023 · 5 comments
Closed

User id conflict when importing from the command line #392

prairietree opened this issue Apr 8, 2023 · 5 comments

Comments

@prairietree
Copy link

Hello, I used occ to export a user from one NextCloud server. It took a long time but it seems to have finished successfully.

I got the file copied to the new system but am unable to import it. If I have the specified account it says user already exist and will not load. If I do not have the user account, it says account does not exist. At the one point it looks like there is a prompt but it just aborts without giving me a chance to answer it.

$ docker exec --user www-data nextcloud-app-1 php occ user:import -n --user=newuser /backup/old-user_2023-04-06_07-50-24.zip

 [ERROR] User <newuser> does not exist                                           

$ docker exec --user www-data nextcloud-app-1 php occ user:import -n --user=newuser /backup/old-user_2023-04-06_07-50-24.zip

 [WARNING] A user with this uid already exists!                                 

aborted.
$ docker exec --user www-data nextcloud-app-1 php occ user:import --user=newuser /backup/old-user_2023-04-06_07-50-24.zip

 [WARNING] A user with this uid already exists!                                 

 Do you really want to overwrite this user with the imported data? (yes/no) [no]:
 > aborted.
$
@prairietree prairietree changed the title User id conflix when importing from the command line User id conflict when importing from the command line Apr 8, 2023
@Pytal

This comment was marked as outdated.

@come-nc
Copy link
Collaborator

come-nc commented Apr 20, 2023

If you want to import in a new user you must not pass the --user option. (that answers your first try, it says the user do not exists because you specify a user to overwrite but it does not exists)

@come-nc
Copy link
Collaborator

come-nc commented Apr 20, 2023

The second problem comes from docker I think, you run the command in non-interactive mode so you cannot answer the question.
Please try with «exec -it» instead.

@Pytal
Copy link
Member

Pytal commented Apr 21, 2023

If you want to import in a new user you must not pass the --user option. (that answers your first try, it says the user do not exists because you specify a user to overwrite but it does not exists)

🙈 somehow thought it was already able to create a new user with a passed uid so tracking in #398

@prairietree
Copy link
Author

Thanks for the replies. I ended up doing more of a manual move. Coping the files and running a files scan. I am happy with that and it was much faster (about an hour vs two+ days). It also kept different versions so that was nice.

If someone gets a chance to try the above suggestions, please let us know how it worked for you.

Thanks again everyone for your help.

@Pytal Pytal closed this as completed Apr 25, 2023
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

3 participants