Upgrading the PinePhone MainBoard
Tags: pinephone, ubuntutouch
Published: 2020-11-20 22:58:42


## backing up

At the time of writing Ubuntu Touch has many issue around mounting, sharing files, moving files, etc, so its not as simple as just copying and pasting your files from your storage to your SDcard, unless you know your way around the command line.

I decided to back my PinePhone up using the already pre-installed JumpDrive, to enter this, just volume up as you power on the phone, a image of Yumi should appear, saying that its waiting for a command, if you plug in the PinePhone you'll get a big list of mountable drives, we want to mount userdata, than move up into user-data and then phablet.

This gives us a view of all our documents, I selected all the files and straight copied and paste them into a PinePhone sub folder so that I can easily copy and paste them back onto the PinePhone after the upgrade, ultimately this also gives me the ability to properly look the files to remove any old outdated files and just organize my phone a bit more.

## Flashing JumpDrive

You'll need a spare SDcard that you don't mind writing over, the new PinePhone mainboard doesn't come with any OS pre-installed, so we have to give the phone a OS to boot off, so that we can flash Ubuntu Touch later!

First download the latest [JumpDrive](https://github.com/dreemurrs-embedded/Jumpdrive/releases/tag/0.6), once that's downloaded, use your favourite flasher, I personally use Etcher, though other people may rather use dd.

After that's flashed you can forget about it until we've installed the mainboard.

## Taking apart the PinePhone

Unplug and turn off the PinePhone, take the back cover off, there's a little lip in the bottom right, take the battery out, and remove your SDcard and/or Sim card if you have any installed, this isn't necessary however it means as soon as the mainboard is out, you don't need to worry about it again.

Next is to unscrew the inner frame, this has 15 screws, including a warranty screw, as soon as you remove that screw you have voided your warranty, put the screws to the side, they're all the same size so you don't have to worry about which ones go where, but do keep them safe, because you don't get any extra's, Gently lift up the inner frame, holding onto it from the gap where the battery was, and the outer-side, gently pull it up, holding the rest of the phone down if necessary.

Great you're at the level where you can remove the mainboard, this bit is a bit fidgety, first remove the tags at the bottom of the mainboard gently, these are the easiest to remove, then lift the antenna cable up off the mainboard, there are 3 left to do at this stage, the one on the left, and two on the top, leave the cameras for now, these are easier to remove when the mainboard is out of the case, flip the piece that's keeping the ribbon cables in, and gently remove the cables.

If you didn't use a tool for the last part you'll want one now, the mainboard is kept in place by some tabs, and if you try to remove the mainboard with your nails, you'll most likely hurt yourself, you don't want to use anything metal either as you may damage your mainboard, however, if you have a plastic prying tool that should work fine, if all you have is metal, you can use that, just make sure to be careful.

Get your tool under the mainboard, and lift it up gently, moving around the mainboard, as they un-clip, then when all the tabs are un-clipped, you can take the mainboard out with your hand, next flick the locks on the mainboard for the camera's and remove them from the mainboard, you'll want to add these to your new mainboard before you put the new mainboard in the case.

## Putting it back together

Grab your new mainboard, and open up all the slots for input, slide in the ribbon cables for the camera's, and clip them back in, now you can put the mainboard back in, make sure the mainboard has the kill switches facing you, put the mainboard in the phone, but be careful not have the cables above the mainboard, so you don't squish or break any when you're pushing the new mainboard down, as long as the cables are above the mainboard, push down until you hear the tabs click and hold the mainboard back in place, you may need to wiggle it around a little.

Put the rest of the ribbon cables back in and close the tabs, this may be a bit finicky, but if you give it a few goes you'll be okay, the hardest one to put back in, is the antenna cable, you may want to pull the cable out of the phone a bit to give yourself more wiggle room to get it hooked up, its also recommended that you use something like a flat ended screwdriver to push the cable back in, then make sure you push the cable back into the space its allotted.

After all the cables are in, plug in your SDcard with JumpDrive installed, and battery, its best to test the device before you put it back together again, if the screen turns on and JumpDrive starts, you haven't destroyed your device.

Remove the battery again and put the inner frame back on, screw the frame back into place, and put your battery back in.

You also get a thermal pad with your mainboard, that sticks onto the inner part of the back cover so you may want to add that now, then put your back on.

## Ubuntu Touch Time

Download the latest version of Ubuntu Touch from the official [Jenkins](https://ci.ubports.com/job/rootfs/job/rootfs-pinephone-systemimage), if you use etcher you can use the compressed file to flash, however all this does is extract the file somewhere else and then pushes it to your phone, this is usually okay if the file that's being extracted isn't to big, but the file that comes out the other end is about 13GB's so I recommend extracting it somewhere locally, that way if something goes wrong, you know where, you know why, and you know what to do about it, also extracting large archives like that can take a tole on a computer, especially if your computer is lower end, so don't do much while extracting, unless you have a powerful computer.

After the img is extracted, turn your phone on and plug it in, then flash with your favourite flashing tool, however, be aware that with JumpDrive gives you an option to write to the eMMC or the SDcard, make sure you get the right partition (eMMC if you want it internally), for me the eMMC drive was located at /dev/sde.

Wait for that to finish flashing, turn off your phone, open your phone back up for the last time, remove your JumpDrive Sd card and insert your normal one and you Sim card if you so wish, and turn the phone back on for its first boot.

It takes a bit longer to boot on first run, but after its finished booting, go through the setup wizard, and check that everything else is working, such as sound, Bluetooth, cameras, etc, to make sure that you've connected everything correctly before you start bringing all your stuff over.

## Migration

To migrate your stuff we turn off the phone, and turn it back on holding volume down, then remember where your data should be stored on the phone? userdata/user-data/phablet, so copy and paste your back up folders into that folder.

You may run into permission errors, and if so you can use 

> sudo chmod 772 * -R

If you're not comfortable with the command line than I don't recommend restoring your data like this, and rather just reinstall everything and use your sd card to transfer your files in your standard directories back.

after you've copied everything you want back, reboot into Ubuntu Touch, open the terminal and use

> ls -laR 

Check and see who the owner and group the files belong to, if they belong to "system" then Ubuntu Touch wont be able to use them, the easiest way to fix the owner issue, is by using this command

> sudo chown phablet:phablet -R

This changes every file from your home directory to be owned by phablet, and this will fix a lot of issues you have later when reinstalling apps, or trying to look at your images in the gallery app.

install UB tweak tool, and then install your other apps, if any app just shows a blank page, or doesn't work after the update, you're going to have to clear data, and start again with that app unfortunately.

## Enjoy

Enjoy playing with your new 3GB version of the PinePhone!