Skip to content

Upgrading From Versions Prior To 20190119

jasaw edited this page Feb 11, 2019 · 2 revisions

Do not attempt to update from versions prior to 201901119 automatically! Due to the different partition layout, you'll need to either rewrite the OS image from scratch (recommended) or use the following procedure to manually upgrade your system.

The following procedure WILL remove all your media files, but will preserve configuration, such as WiFi credentials or static IP. Make sure you back up your media files before running these commands!

The following procedure is not guaranteed to succeed, due to temporary partition overlapping!

  1. Log in via SSH/putty.

  2. Remount your partitions read-write:

     mount -o remount,rw /
     mount -o remount,rw /boot
    
  3. Back up your /data/etc folder (config files) and /data/varlib to your boot partition:

     tar -acf /boot/backup-etc.tar.gz -C /data etc
     tar -acf /boot/backup-varlib.tar.gz -C /data varlib
    
  4. Download and inject the backup restoring script from motionEyeOS git:

     curl https://raw.githubusercontent.com/ccrisan/motioneyeos/bbefaee0423c396b0f0fcf9eabc5001576291658/board/common/overlay/etc/init.d/S02restorebackups -o /etc/init.d/S02restorebackups
     chmod +x /etc/init.d/S02restorebackups
    
  5. Patch your S00datapart init script to allocate the new data partition starting at 1GB:

     sed -ri 's/data_start=(.*)/data_start="2097152"/' /etc/init.d/S00datapart
    
  6. Remove your data partition:

     echo -e "d\n3\nw" | fdisk /dev/mmcblk0
    
  7. Reboot and pray:

     reboot
    
  8. Recreate the boot and root partitions according to new layout:

     echo -e "d\n1\nd\n2\nn\np\n1\n2048\n63487\nn\np\n2\n204800\n614399\nt\n1\nc\nw" | fdisk /dev/mmcblk0
    
  9. Run the upgrade command (and pray again):

     fwupdate upgrade 20190119  # do not try other versions!
    
  10. Assuming a successful upgrade to 20190119, you can now upgrade to higher versions using usual methods.