Migrating a running Debian installation to another Architecture
Introduction
Users sometimes want to convert their existing Debian installation to another architecture. ArchTakeover is the working name for tool planned for this purpose.
It should find installed packages, preserve user data and backups of the old system configuration. The new system is a clean Debian system; it's not a chroot, and no binaries of the old architectures should remain, except for hand-installed binaries left in backup directories.
Use cases
1. Hanna has a boring white box PC. One day she upgrades it to a new PC that can run AMD64 instructions. She want to take advantage of the new instruction set and convert her existing Debian/i386 install to Debian/amd64.
2. Eddy has a existing Debian/arm installation on a Linksys nslu-2. floating point performance is too low and he can't use thumb instructions to save memory. Thus he wants to convert her install to Debian/armel.
3. Jussi has a powermac G5 running Debian/powerpc. One day it breaks, and as a big Apple fan he replaces it with Mac pro. He wants to move his hard drive over to new machine, and replace the powerpc install with a identical i386 or amd64 install.
Implementation
The user needs to start with booting a kernel and initramfs of the new architecture. The initramfs has a tool that scans the install partition, digs data from existing install, and after moving the old install to backup directory start installation. Now the problem starts sounding very much like d-i. Therefor it is likely easiest implemented using d-i.
2) the new arch-upgrade debian-installer module
- adding a new module to d-i, that scans found partitions for existing debian installs.
--------------------------------------------------- | Existing debian installation found on partition | | /dev/sda (architecture arm). Do you want to | | convert it to debian/armel? | | Yes NO | ---------------------------------------------------
- Alternatively the configuration and application selection can be used from one partition to install a identical Debian on another partition.
2) Pulling data from existing install
- dpkg --get-selections
3) Safety checks:
- Are all packages that where installed on previous arch available on the new arch?
- Is there enough space (50+% free?)
- Is there any oldabi binaries outside debian install in /opt or
- /usr/local
- and so on In any case odf any problems, warn user. Even if everything is ok, warn that user should have backups done..
4) The actual arch-upgrade script (this still needs discussion and planning)
- Move the existing installation out of way
- Run debootstrap as normal
- copy over old /etc and selected parts of /var
- install the rest of packages
- move the rest of relevant directories back ( /home )
- install new-arch kernel and make system bootable.
5) skip rest of debian-installer steps
Open questions
- Arch specific configuration data in /etc ? do we have known cases?
- Arch specific data in /var ? do we have known cases?
Usage
User follows the d-i instructions to boot the kernel and initramfs of the new architecture.
Insipiration
DebianTakeover DebianInstaller