Migrating from 32bit to 64bit Linux: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
= How we made it = | = How we made it = | ||
{{ | {{Info|This will also apply if you just move to another hardware or VM.}} | ||
= About | = About the approach = | ||
In theory, you can exchange the i386 by with amd64 binaries. We tried that, and gave up. The approach shown here is (in our opinion) the most viable option. | In theory, you can exchange the i386 by with amd64 binaries. We<ref>That's me and my friend [https://www.pocnet.net PoC]</ref> tried that, failed several times, and finally gave up. The approach shown here is (in our opinion) the most viable option. | ||
== The basic idea == | == The basic idea == | ||
* Install a new system, matching your distribution release, in this case debian 11.6 | * Install a new system, matching your distribution release, in this case debian 11.6 | ||
* Install the same packages, but in 64bit | * Install the same packages, but in 64bit | ||
* Move /etc and /var to the new system | * Move <code>/etc</code> and <code>/var</code> to the new system | ||
* Stop the old system | * Stop the old system | ||
* Mount /home on your new system | * Mount <code>/home</code> on your new system | ||
* Reboot | * Reboot | ||
Line 31: | Line 31: | ||
diff dpkg_list_oldserver.txt dpkg_list_newserver.txt |grep '^<' |awk '{print $2}' | diff dpkg_list_oldserver.txt dpkg_list_newserver.txt |grep '^<' |awk '{print $2}' | ||
diff dpkg_list_oldserver.txt dpkg_list_newserver.txt |grep '^>' |awk '{print $2}' | diff dpkg_list_oldserver.txt dpkg_list_newserver.txt |grep '^>' |awk '{print $2}' | ||
* Disable /etc/cron.d/certbot | * Disable <code>/etc/cron.d/certbot</code> | ||
* Make sure, all mods are installed: ls -1 /etc/apache2/mods-available | * Make sure, all mods are installed: <code>ls -1 /etc/apache2/mods-available</code> | ||
* Copy the needed portions of /root to your new machine | * Copy the needed portions of <code>/root</code> to your new machine | ||
* Put [[Nextcloud]] in maintenance mode: <code>sudo -u www-data php occ maintenance:mode --on</code> and wait 5 minutes | * Put [[Nextcloud]] in maintenance mode: <code>sudo -u www-data php occ maintenance:mode --on</code> and wait 5 minutes | ||
* Stop services on old system | * Stop services on old system | ||
Line 43: | Line 43: | ||
mysqldump -u root -p --databases MEDIAWIKI_DB > mediawiki_2023-04-03.sql | mysqldump -u root -p --databases MEDIAWIKI_DB > mediawiki_2023-04-03.sql | ||
mysqldump -u root -p --databases NEXTCLOUD_DB > nextcloud_2023-04-04.sql | mysqldump -u root -p --databases NEXTCLOUD_DB > nextcloud_2023-04-04.sql | ||
* First /etc, then /var! | * First <code>/etc</code>, then <code>/var</code>! | ||
* For moving /etc do this on your new system: | * For moving <code>/etc</code> do this on your new system: | ||
cd / | cd / | ||
mv /etc /etc_old | mv /etc /etc_old | ||
ssh root@OLDSYSTEM "cd /; tar cf - etc" |tar xvf - | ssh root@OLDSYSTEM "cd /; tar cf - etc" |tar xvf - | ||
cp -pr /etc_old/fstab /etc/ | cp -pr /etc_old/fstab /etc/ | ||
* For moving /var do this on your new system: | * For moving <code>/var</code> do this on your new system: | ||
cd / | cd / | ||
mv /var /var_old | mv /var /var_old | ||
Line 62: | Line 62: | ||
* End maintenance mode: <code>sudo -u www-data php occ maintenance:mode --off</code> | * End maintenance mode: <code>sudo -u www-data php occ maintenance:mode --off</code> | ||
* Check syslog and daemon.log | * Check syslog and daemon.log | ||
* Check /var permissions | * Check <code>/var</code> permissions | ||
* Test all services | * Test all services | ||
* Test aptitude/dpkg: | * Test aptitude/dpkg: | ||
Line 71: | Line 71: | ||
{{Success|That's it!}} | {{Success|That's it!}} | ||
---- | |||
Footnotes: | |||
<references/> | |||
[[Category:Linux]] | [[Category:Linux]] |
Latest revision as of 19:59, 21 June 2023
About
I ran lots of different systems:
- NetBSD (on digital alpha, on 68K Macintosh and PPC Macintosh)
- PowerPC Linux (on PowerMac G3)
- Debian (VM) for the last 15 years or so, hosted with my favourite hoster, Mathias Peter.
How we made it
ℹ️ | This will also apply if you just move to another hardware or VM. |
About the approach
In theory, you can exchange the i386 by with amd64 binaries. We[1] tried that, failed several times, and finally gave up. The approach shown here is (in our opinion) the most viable option.
The basic idea
- Install a new system, matching your distribution release, in this case debian 11.6
- Install the same packages, but in 64bit
- Move
/etc
and/var
to the new system - Stop the old system
- Mount
/home
on your new system - Reboot
In detail
- Make backups and snapshots
- Make sure all packages are installed, f.e. like this
# Do this on the old system dpkg -l |grep '^ii' |awk '{print $2}' |sort > dpkg_list_oldserver.txt
# Do this on the new system dpkg -l |grep '^ii' |awk '{print $2}' |sort > dpkg_list_newserver.txt # Compare installed and install missing packages diff dpkg_list_oldserver.txt dpkg_list_newserver.txt |grep '^<' |awk '{print $2}' diff dpkg_list_oldserver.txt dpkg_list_newserver.txt |grep '^>' |awk '{print $2}'
- Disable
/etc/cron.d/certbot
- Make sure, all mods are installed:
ls -1 /etc/apache2/mods-available
- Copy the needed portions of
/root
to your new machine - Put Nextcloud in maintenance mode:
sudo -u www-data php occ maintenance:mode --on
and wait 5 minutes - Stop services on old system
apachectl -k stop /etc/rc6.d/K02dovecot stop /etc/rc6.d/K01postfix stop
- Set your Mediawiki to $wgReadOnly
- Just in case, dump the databases
mysqldump -u root -p --databases MEDIAWIKI_DB > mediawiki_2023-04-03.sql mysqldump -u root -p --databases NEXTCLOUD_DB > nextcloud_2023-04-04.sql
- First
/etc
, then/var
! - For moving
/etc
do this on your new system:
cd / mv /etc /etc_old ssh root@OLDSYSTEM "cd /; tar cf - etc" |tar xvf - cp -pr /etc_old/fstab /etc/
- For moving
/var
do this on your new system:
cd / mv /var /var_old ssh root@OLDSYSTEM "cd /; tar cf - var" |tar xvf - rm -r /var/cache/apt /var/lib/apt /var/lib/aptitude /var/lib/dpkg cp -pr /var_old/cache/apt /var/cache/ cp -pr /var_old/lib/apt /var/lib/ cp -pr /var_old/lib/aptitude /var/lib/ cp -pr /var_old/lib/dpkg /var/lib/
- Shutdown old system and mount /home on new system
- Reboot new system
- End maintenance mode:
sudo -u www-data php occ maintenance:mode --off
- Check syslog and daemon.log
- Check
/var
permissions - Test all services
- Test aptitude/dpkg:
apt list --installed dpkg -l apt-get update apt-get dist-upgrade
✅ | That's it! |
Footnotes: