Migrating from nextcloud box to nextcloudpi

Hello,

I have a nextcloud box installation, and I’d like to use instead nextcloudpi since this project appear to be better maintained.

I have no clue where to start, beside @nachoparker’s website, which do contain some installation procedure, but I did not find how to handle existing data from the nextcloud box.

Could someone let me know a step by step procedure with the specificity of the nextcloud box installation, so I don’t lose my data ?

I have a Raspberry 2 with nextcloud version 11.0.5.

Thanks

No written process for that at the moment.

I suggest that you

  • copy your data to a PC
  • export calendars, news feeds, contacts and everything you can think of
  • install and configure NCP
  • create users again
  • import everything and copy data back

If you think that the process will be useful for others, feel free to write the steps in the NextCloudPi wiki

Thanks for your answer. I actually need a bit more help to start, but I’d be happy to document what I’ll learn.

  • copy my data to a PC: ok
    Well, almost, the reason is that it’s just to have a backup of the data, in case of something goes wrong ?
  • export calendars, etc… ok.
    Same ?
  • install and configure NCP: not ok.

I guess I need to install with option 1: Run from SD card, right ?
What do I do with the SD card that I got from the nextcloud box ? Shall I buy another one or can I erase the nextcloud box stuff, or it’s better to keep that one, in case of failure ? Other option ?
What do I do with the hard drive provided with the nextcloudbox ? I just let it as such and nextcloudpi will find the data back at the end ?

Sorry for the many “basic” questions, but I don’t really feel confident trying stuff I just guess based on general how-to.

Thanks

You can reuse it for sure. You might want to make a copy in your PC, but it is not necessary.

NCP will detect the hard drive, and I recommend that you format it (from NCP menu). In that step, all its contents will be erased (therefore the copy). Then, you can put your data back in again.

Ok, I can make a copy of the entire SD card in case I want to switch back to the snappy installation right ? Will the command sudo dd bs=4M if=NextCloudPi_XX-XX-XX.img of=/dev/sdx erase the card and replace it with the img ? Or it will just copy the img ? How the the Raspberry will know to boot from this image ? Is it because of the /dev/ location ?

In case it just copy, will the ssh config file will be the same and I’ll be able to connect with my former password, won’t I ?

Thanks!

yes

yes

because you replaced the image in the SD card with the one from NCP

user will be pi, password will be raspbian. Follow the NCP wiki for details like this.

Hello,

So I moved on a bit, Here is a summary:

  1. Copy all data from the WD hard drive to my computer
  2. Remove SD card foom NCBox and plug it in you computer
  3. Copy the content of it in case it goes wrong (Actually I’m not sure if I did it correctly since there are different partitions in it and I just copy the content of what was available in Finder, I think only the boot partition).
  4. Download the NCP image and check md5sum
  5. unmount the SD card (do not eject it), and get its device BSD name (e.g. disk4s1) (see https://www.raspberrypi.org/documentation/installation/installing-images/mac.md)
  6. flash it with sudo dd bs=4m if=NextCloudPi_12-04-17.img of=/dev/disk4 (not bs=4M on mac)
  7. run the command sync
  8. unplug and replug the SDcard
  9. cd /Volumes/
  10. touch ssh
  11. eject the SD card
  12. insert it in the raspberrypi
  13. start
  14. go to nextcloudpi.local
  15. Remove the former ssh key from known host in .ssh/known_host in your home computer.
  16. ssh pi@<ip>
  17. password: raspberry (not raspbian)
  18. Type passwd to change the ssh password

So far so good, but I still have some issues:

I have a nextcloud instance working, but I’m not really sure how to recover my data, since there are still on the HD, and running the format USB drive from the ncp wizard, did not work (don’t recall the error). But then, since I still have the data on the drive, isn’t it easier to move them at the correct position ?

I still have a problem with let’s encrypt, as described here: No automatic renewing of Letsencrypt certificate on Nextcloud Box
The error message from the WebUI is:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for myserver.host.com
Using the webroot path /var/www/nextcloud for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. myserver.host.com http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching http://myserver.host.com/.well-known/acme-challenge/j735rSOInHBFicM4lG0eLOkHkKNEahUW0Hvu8rrNoSQ: Timeout
IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: myserver.host.com
   Type:   connection
   Detail: Fetching
   http://myserver.host.com/.well-known/acme-challenge/j735rSOInHBFicM4lG0eLOkHkKNEahUW0Hvu8rrNoSQ:
   Timeout

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address. Additionally, please check that
   your computer has a publicly routable IP address and that no
   firewalls are preventing the server from communicating with the
   client. If you're using the webroot plugin, you should also verify
   that you are serving files from the webroot path you provided.

Would you have any insight ?
it might be related to this: https://community.letsencrypt.org/t/timeout-on-certification-creation-behind-ipv6-and-ipv4-adsl-box/38164
Where the conclusion is that I can’t get a let’s encrypt certificate anymore when using the DNS from my ISP provider (free, french ISP).

Then I thought, well, let’s go for freeDNS. So I register there, but then, I don’t know whether I should create a subdomain, a domain, or anything else, and where to click and so on… Any help would be appreciated !

Thanks

hi,

thanks for writing down the steps for others… keep it up!

regarding letsencrypt… probably your ports are not correctly forwarded. NCP tries to do this automatically but it does not always work (as explained in the wizard).

I suggest you paste here the output of nc-info (in ncp-web, or nextcloudpi-config). It will detect if your ports are open, otherwise if autoforward doesn’t work you will have to do it manually (see wiki).

In some (sad) cases your ISP will block some ports, or you will be behind a cg-nat. Nothing we can do about that other than changing ISPs, but in many cases you can contact them and have it fixed for you.

regarding the USB drive… I would be interested in seeing why it fails… if you could paste the output it would be helpful. Remember that formating will remove all data on the drive, so you should have the data on your PC or somewhere else.

after formatting, and moving the datadir, you could either

  • re-upload (sync or NC web interface), or
  • shutdown pi, plug USB into desktop, copy files over, replug, turn on pi, run nc-scan for NC to recognize the new files.

For let’s encrypt, it used to work, and at one point they changed something on their side and it did not work for me anymore.
Here is the log of nc-info:

Gathering information...
NextCloudPi version  v0.41.11
NextCloudPi image    NextCloudPi_12-04-17
distribution         Raspbian GNU/Linux 9 \n \l
automount            yes
USB devices          sda 
datadir              /var/www/nextcloud/data
data in SD           yes
data filesystem      ext2/ext3
data disk usage      1.9G/3.6G
rootfs usage         1.9G/3.6G
Nextcloud check      ok
Nextcloud version    12.0.4.3
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
Postfix service      up
internet check       ok
port check 80        open
port check 443       open
IP                   192.168.0.4
gateway              192.168.0.254
interface            eth0
certificates         none
certs due            none
NAT loopback         no
uptime               8:36

You should enable dnsmasq to use your domain inside home

You should run Lets Encrypt for trusted encrypted access

You should use nc-datadir to move your files to your plugged in USB drive [Jean: done in the wizard afterward]

I’ve redone the usb drive wizard and it worked this time (it’s empty now). Note that in the WebUI, nc-datadir is not ticked while nc-automount is. Where can I get the name of the mounted HD ? And how can I be sure that’s everything is ok ?

I also have a small issue with the accounts. How can I rename the admin account ? Also, I have disabled one but can’t enable it again (it disappeared).

Thanks

your ports seem to be open… can you access from outside, even if you get untrusted certificate warning?

the problem you are facing is a connectivity one. if you are positive that port forwarding configuration is correct (that’s what it seems), contact your ISP, maybe they changed something.

with nc-info :wink:

better ask in the general forum

Ok, thanks.

I sometime have “Unauthorized request. Try reloading the page” from the ncp WebUI, what does it mean ?

it means that your session has expired. We need to make that warning more friendly and easier to understand

Ok, but reloading the page doesn’t change anything. What mechanism trigger the reconnection ?
So far I log out from nextcloud and log in back, reload the window, click on shutdown (what does it shut down ?) close the window, open another, and it eventually work again.

Thanks !

Well, of course the Nextcloud web has far more work put into it than the nextcloudpi web, which is very basic.

Depending on your browser you might have to refresh without cache ( ctrl+F5 ), or open the URL in a new tab to force actually asking the web server for a new page.

That’s on the list to be improved, but not very high priority :wink:

You can open an issue on github if you want to track it and know when it gets fixed.