Migrate users to new NS


(Shawn) #1

OLD-SERVER = Nethserver 6.8 with LDAP and OwnCloud 7
NEW-SERVER = Nethserver 7.4 with LDAP and Nextcloud 12

Question I have is, how do I migrate or export/import several/all users from OLD-SERVER to NEW-SERVER?

Both are running slapd (OpenLDAP) and both are masters.
Can I restore a backup from OLD-SERVER to NEW-SERVER even though they are different versions?
I would be bummed if I had to do each user by hand or wipe and install 6.8 on NEW-SERVER to restore a backup and then upgrade everything.

(Markus Neuberger) #2

Hi @FesterJester,

yes, that’s one of the supported methods but you may also use rsync:


(Craig) #3

I just did this, used rsync to copy the data and upgrade the new server. This will add in owncloud instance to the new server. Once the new server is up and running, add Nextcloud via the Software Center. After that you will be able to run the migration script

/usr/share/doc/$(rpm -q --queryformat "%{NAME}-%{VERSION}" nethserver-nextcloud)/owncloud-migrate

I had to modify the ldap server name afterward in NextCloud, but the transition was smooth.

(cloudenv) #4

rsync is quite shitty
Use gcopy

gcopy -s: source -d: destination

OR ::

use this shitty SQL console

BTW NS should have its own full-migrator

(Stefano Zamboni) #5

as you already been told elsewhere, please change your vocabulary, thank you

there’s a rsync based migration how to and that’s why it’s used

it already has, since epoch, it’s called “backup and restore”

(Shawn) #6

So, I have tried the rsync method from http://docs.nethserver.org/en/v7/upgrade.html#upgrade-with-rsync-section.
All the data has moved from OLD-SERVER to NEW-SERVER.
However the user accounts do not appear to have moved.

I then tried /usr/share/doc/$(rpm -q --queryformat "%{NAME}-%{VERSION}" nethserver-nextcloud)/owncloud-migrate , but the command appears to do nothing.


use this shitty SQL console

What do you mean?

I think next I am going to try the “Upgrade from backup” method

(Craig) #7

There should have been some kind of feedback from the script, check that you have /var/www/html/owncloud and that all of the original users and files are there.

To see which users are in nextcloud run this command:

su - apache -s /bin/bash -c "source /opt/rh/rh-php56/enable; cd /usr/share/nextcloud/; php occ user:list"

(Shawn) #8

Your command only lists the two users listed in the NEW-SERVER dashboards “users and groups” tab.
None of the users from OLD-SERVER.
All the original users data from OLD-SERVER is on NEW-SERVER.

(Craig) #9

I’m guessing that the database doesn’t have any owncloud users and the script just exits without any feedback.

Try this

mysql -e "select * from owncloud.users"

If no users show up then the database doesn’t have any users for owncloud, and the script thinks all the migration is done and exits out.

There really should be an echo out in the script for this condition.

(Shawn) #10

I just get:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I know there is a way to log into mysql locally, I just have to remember how.

(Craig) #11

I was doing come checking and the owncloud.users table is locally created users.
Check the owncloud.ldap_user_mapping table for ldap users.

You could try mysql -u [user] where [user] is another database user you have the password for.

(Alessio Fattorini) #12

@FesterJester did you happen to resolve?

(Shawn) #13

I have not resolved it yet.
I tried a clean Nethserver 7 install on the NEW-SERVER and restored the backup config and data from the Nethserver 6 (OLD-SERVER).
All the data and config restored successfully and OwnCloud was functioning on the NEW-SERVER.
I was still unable to get the user accounts migrated from OwnCloud to NextCloud.

I have since changed jobs and no longer have access to the systems.
Sorry I am unable to follow through to a solution for this thread.

(Alessio Fattorini) #14

Take a look at this doc: