Migration - linuxmuster/sophomorix4 GitHub Wiki

Migration from linuxmuster.net 6.x to 7.x

  • All data is moved into the default-school

A: Save data from old 6.x server

The old server must be in a synchronised state. For this do the following:

  • run the following:

    1. # sophomorix-check
    2. # sophomorix-add
    3. # sophomorix-move
    4. # sophomorix-kill
  • When you run sophomorix-check again, there should be no user to be added, moved or killed.

Then do the following on the old server V6:

  • Install sophomorix-dump from the babo repository:

    # apt-get install sophomorix-dump

    If you don't want to include the babo repository do:

    • Go to: http://pkg.linuxmuster.net/babo/
    • Download the latest sophomorix-dump_u.v.w-z_all.deb
    • Install it with: # dpkg -i sophomorix-dump_u.v.w-z_all.deb
  • Run the dump script:

    # sophomorix-dump

    This should run without errors.

    The following ERROR can be ignored:

    ERROR dumping: /root/sophomorix-dump/data/etc/sophomorix/user/mail/*

    You find the dumped data in:

    /root/sophomorix-dump

  • Copy /root/sophomorix-dump (up to 15 MB) on the new LML7 Server.

  • Clean up the old server (the dumped files you created before), if you wish:

    # sophomorix-dump --clean

B: Import the data on 7.x server

The Migration works only on an 7.x server that has NO additional users,groups,projects added. Just the users of the linuxmuster setup are allowed.

Install the sophomorix-vampire scripts:

# apt update

# apt install sophomorix-vampire

There are 2 scripts that help you with the import:

  1. The script that does the job step by step:

    sophomorix-vampire

    See sophomorix-vampire -h for the options and steps

  2. An example script, that does everything for a typical school:

    sophomorix-vampire-example

Steps of migration:

1. Test if dump is complete, read INFO, ERRORS and WARNINGS:

`# sophomorix-vampire --datadir /path/to/dir/sophomorix-dump --analyze`

This will show you

  • ERROR: missing files (/etc/sophomorix/user/mail/* is not used on every installation)
  • INFO: groups that are renamed during migration
  • WARNING: about overwriting files, ...

2. Create class script and run it:

# sophomorix-vampire --datadir /path/to/dir/sophomorix-dump --create-class-script

# /root/sophomorix-vampire/sophomorix-vampire-classes.sh

This will create a script that creates the classes before the users (with the renamings of step 1)

Tests

# sophomorix-class -i

# sophomorix-class -i --class teachers

3. Create file sophomorix.add and add these users

First disable password length and complexity restrictions of samba4 to allow simple passwords:

# samba-tool domain passwordsettings set --complexity=off

# samba-tool domain passwordsettings set --min-pwd-length=1

Then create an sophomorix.add file from the dumped data:

# sophomorix-vampire --datadir /path/to/dir/sophomorix-dump --create-add-file

Copy it to the right place, and add the users (this will take time, about 1 second per user)

# cp /root/sophomorix-vampire/sophomorix.add /var/lib/sophomorix/check-result/sophomorix.add

# sophomorix-add -i

(Read ERRORS and WARNINGS, fix them manually)

Then add the users (this will take time, about 1 second per user)

# sophomorix-add

  • The users are added with their firstpasswords

  • The users are added without webui permissions (maybe this will be added later in this step)

    Tests

    Test if firstpasswords work: (At this stage 100% should work)

    # sophomorix-passwd --test-firstpassword

4. Import the hashed passwords into AD

The hashed passwords are imported with:

# sophomorix-vampire --datadir /path/to/dir/sophomorix-dump --import-user-password-hashes

The result should be : 0 ERRORS:

Then Force complex passwords (which is the default):

# samba-tool domain passwordsettings set --complexity=default

# samba-tool domain passwordsettings set --min-pwd-length=default

Tests

Test if firstpasswords work: (At this stage only some should work, according your password policy)

# sophomorix-passwd --test-firstpassword

Show one user or more:

# sophomorix-user -i

# sophomorix-user -i --user <name>

# sophomorix-user -i --user <na*>

5. Create script to add administrators to classes and run it

# sophomorix-vampire --datadir /path/to/dir/sophomorix-dump --create-class-adminadd-script

# /root/sophomorix-vampire/sophomorix-vampire-classes-adminadd.sh

6. Create project script and run it

This step will create all projects.

# sophomorix-vampire --datadir /path/to/dir/sophomorix-dump --create-project-script

# /root/sophomorix-vampire/sophomorix-vampire-projects.sh

Tests

Show one project or more:

# sophomorix-project -i

# sophomorix-project -i -p <name>/<p_name>

# sophomorix-project -i -p <p_na*>

7. Copy configuration files into new server

This will modify some files.

You must run the script TWICE! (Guess its a bug)

# sophomorix-vampire --datadir /path/to/dir/sophomorix-dump --restore-config-files

You should then edit school.conf to to your liking (This is not automatically updated!)

8. Do a sophomorix run to update utf8, webui-permissions and maybe more

# sophomorix-check

Verify that there are no users to be added:

# sophomorix-add -i

Update user names to utf8, set sophomorixWebuiPermissionsCalculated, ... maybe more

# sophomorix-update

Delete overdue users (according to your settings in school.conf)

# sophomorix-kill

Tests

Check if special chars are imported into AD (if you have special chars in students.csv and teachers.csv):

# sophomorix-user -i -u <user_with_umlaut>

9. Add the workstations

# linuxmuster-import-devices --dry-run

# linuxmuster-import-devices

Tests

Test if workstations are there:

# sophomorix-device -d firewall -i

# sophomorix-device -r no-pxe -i (rooms Bug: zeigt auch hardwareclass)

Test if dns works:

# sophomorix-device --dns-test

10. Run some tests with users and groups

# sophomorix-vampire --datadir /path/to/dir/sophomorix-dump --verify-uid

11. Syncing user data with rsync

Mount the old server home somewhere (for example to /mnt), so you can see:

/mnt/home/share

/mnt/home/students

/mnt/home/teachers

and specify your mount directory as: --path-oldserver /mnt

Do some tests for a single student, teacher, class, project:

# sophomorix-vampire --rsync-student-home <student> --path-oldserver /mnt

# sophomorix-vampire --rsync-teacher-home <teacher> --path-oldserver /mnt

# sophomorix-vampire --rsync-class-share <class> --path-oldserver /mnt

# sophomorix-vampire --rsync-project-share <project> --path-oldserver /mnt

Sync all data of students, teachers, classe, projects:

# sophomorix-vampire --rsync-all-student-homes --path-oldserver /mnt

# sophomorix-vampire --rsync-all-teacher-homes --path-oldserver /mnt

# sophomorix-vampire --rsync-all-class-shares --path-oldserver /mnt

# sophomorix-vampire --rsync-all-project-shares --path-oldserver /mnt

12. Linbo :

Sync linbo data:

# sophomorix-vampire --rsync-linbo --path-oldserver /mnt

Reinstall linbo to update stuff:

# apt-get --reinstall install linuxmuster-linbo7 linuxmuster-linbo-common7

13. What else to do by hand

  • add descriptions to projects
  • change role of devices
  • set quota

Open Questions

  • should we move quota also (sum up the + values and apply it to the school?)
  • Is there any need to import the dumped data in a certain school?
⚠️ **GitHub.com Fallback** ⚠️