Move nextcloud to new server

I want to move my nextcloud from a shared web host, bluehost, to a digital ocean droplet. How do I do this, and how much memory do I need on the vps to be able to run nextcloud smoothly? Thanks!

  1. Transfer data
  2. Transfer database
  3. adjust settings in config.php to match new system (especially database credentials)
  4. check if its working

Memory depends on the number of concurrent users and the apps you use.

Appreciate it, also able 10 users and able 70 apps

My setup is Ubuntu with Nextcloud, MariaDB, Collabora, redis, and coturn all running in Docker, plus Apache reverse proxy and certbot running on the host. That sits at 1.3 GB RAM with two users.

@KarlF12 – Does your installation run on a VPS?

@kevdog - No, I run it on a VMware ESXi server at home.

Oh awesome – that sounds like a great setup. I tend to use xcp-ng as my hypervisor of choice but honestly I’ve never used ESXi before. I’m curious – how much RAM do you allocate to your Ubuntu VM? 2GB with 1cpu and 2 cores?

I have it set up for 4 cores and 8 GB RAM but it only uses a fraction of that. My server has two 6 core CPUs and 96 GB RAM so I have plenty to throw around.

At the moment, I have 11 VMs running across 3 networks. Nextcloud is just one of them. Actually one of the networks is completely separate with its own instance of pfSense and Nextcloud that I was using for work as a proof of concept.

I spend a lot of time with VMware ESXi clusters at work, so I guess I brought some of that home.

A small VPS with 2 cores and 4 gb ram should be sufficient. Be sure to setup PHP OPcache and a local cache (i’m using APCu) to achieve the best performance.

you can resize your droplet at any time. so start with 2gb and increase/decrease as you like.

for easy setup and testing:

  • find out your running nextcloud version or update to latest. don’t mox versions. check your config.php
  • make a copy of your data and your database
  • create a droplet and put this into userdata:
#!/bin/bash

apt install curl sudo -y

curl -s https://raw.githubusercontent.com/ReinerNippes/nextcloud/nextcloud-reloaded/prepare_system.sh | DEBIAN_FRONTEND=noninteractive /bin/bash
HOME=/root ansible-pull --clean --force --checkout nextcloud-reloaded -d /root/nextcloud -U https://github.com/ReinerNippes/nextcloud.git nextcloud.yml \
-e "\
nextcloud_fqdn='$(curl ifconfig.me)' \
nextcloud_passwd=strenggeheim \
install_collabora=true \
nextcloud_archive=https://download.nextcloud.com/server/releases/nextcloud-18.0.4.tar.bz2 \
"
  • use the .bz2 format as archive
  • check the inventory file for other variable to configure. probably you have to use mysql as database. (it’s mariadb. :wink: )
  • login in to your server and watch the installation progess witch tail -f /var/log/cloud-init-output.log
  • wait for:
TASK [We are ready] ************************************************************
Thursday 30 April 2020  07:03:00 +0000 (0:00:01.363)       0:12:44.346 ********
ok: [localhost] => changed=false
  msg:
  - Your Nextcloud 19.0.0.6 at https://68.183.215.xxx is ready.
  - 'Login with user: admin and password: strenggeheim '
  - 'Other secrets you''ll find in the directory ~/.nextcloud '

PLAY RECAP *********************************************************************
localhost                  : ok=134  changed=85   unreachable=0    failed=0    skipped=50   rescued=0    ignored=0
  • systemctl stop nginx php7.4-fpm redis
  • copy your datafiles to /var/nc-data
  • check old nextcloud instance id in config.php and set it in the new /var/www/nextcloud/config/config.php
    'instanceid' => 'ocnn1b2w6tbo',
  • restore your database
  • systemctl start nginx php7.4-fpm redis
  • connect to the droplet ip address
  • check

if you are happy. edit the inventory file in /root/nextcloud to make your settings permanent.

if you switch from selfsigned to letsencrypt certs, right now you have to sudo apt remove nginx --purge before running the playbook. small bug. sorry. will be fixed soon. nevertheless you have to change the dns record of your domain before.

i just checked this with ubuntu 20.04 on digital ocean.

p.s.: note the restic/rclone backup setup. you may find out the parameters to backup your data/database to do spaces. look at groups_vars/all.yml for the spaces parameters. :wink: