[NC19] How to move user data, without hickups

,

@Mageunic,

Like i said earlier, i did this:

pvcreate /dev/sdd1
vgcreate vg-next-data /dev/sdd1
lvcreate -L 190G -n lv-next-data vg-next-data

mkfs.ext4 /dev/vg-next-data/lv-next-data
mkdir /mnt/ncdata_new
mount /dev/vg-next-data/lv-next-data /mnt/ncdata_new

sudo systemctl stop apache2
sudo systemctl stop postgresql
sudo rsync -avP /mnt/ncdata /mnt/ncdata_new/
umount /mnt/ncdata
umount /mnt/ncdata_new
mount /dev/vg-next-data/lv-next-data /mnt/ncdata

/mnt/ncdata was the zfs pool / on the pool. So i unmounted that, but that is probably not what you mean right? I could go back a snapshot to properly destroy the ZFS pool?

Just so i can write my How to the right way. These are the correct commands to setup user/rights, correct?

chown -R www-data:www-data /mnt/ncdata/.ocdata
chown -R www-data:www-data /mnt/ncdata
chmod -R 770 /mnt/ncdata
chown -R www-data:www-data /var/www/nextcloud

@Operations
the correct command to setup nextcloud :
sudo chown -R www-data:www-data /mnt/ncdata
sudo chmod -R 750 /mnt/ncdata
sudo chown -R www-data:www-data /var/www/nextcloud
sudo chmod -R 750 /var/www/nextcloud

in your case we use 770 instead of 750 because you have “root www-data” not “www-data www-data”

Maybe your ZFS pool did not destroy properly…

to destroy properly a ZFS pool :
sudo umount -f /mnt/ncdata
sudo zpool destroy ncdata

@Mageunic,

I will just reboot now and see what happens. How do i check the errors that appear during booting? Or the “not green OK’s” ?

@Mageunic

I rebooted and now i get an 404 error when i try to open the nextcloud by browser. I noticed this error during booting (not sure why to be honest)

@Operations
can you do this : systemctl status networkd-dispatcher.service and send me the result.

the error 404 is due to the error of networkd-dispatcher.service

@Mageunic
I meant i don’t get why a network service would break down after what we have being doing. That the 404 has got something to do with a network service breakdown i got that :slight_smile:

@Operations try this command :

sudo systemctl start systemd-networkd
systemctl status networkd-dispatcher.service

if there is no probleme , networkd has to be active

sudo systemctl enable systemd-networkd

@Mageunic,

I cannot get it started.

@Operations can you show me what’s more to the right side ?45d57de726fbf946f83c4b6bb26e3b764f87af4e_2_690x313

@Mageunic,

Sorry :slight_smile:

@Operations
after some research, I found this :
sudo chmod 755 /
and reboot

@Mageunic,

Hell yeah! that solved that problem. What did i just do? What does “chmod 755 /” mean / solve? Just trying to understand it a bit better :slight_smile:

Is there a way to check if everything is working now and check if everything is secure?

Nextcloud is up to date and in the settings menu it tells me “passed all checks”.

@Operations
there was a permission problem on the root directory ( "/ ") of your ubuntu

for your nextcloud installation you can test this : https://scan.nextcloud.com

@Mageunic,

Did i / we do something wrong to have caused this permission problem ?

@Operations
in the command, I’ve sent you I see no error on the directories paths
but no problem, we have solved this error.
All is good now ?

@Mageunic,

Since this is my trial run i have to do it again for real. So I thought made it is possible to avoid this problem. But yes this this problem looks solved.

I can run “sudo -u www-data php occ files:scan --all” now without any errors. Should i run anymore commands like that?

I am not able to check the scan website today, will let you know tomorrow if that shows any problems.

@Operations normally you shouldn’t have encountered this problem it is certainly due to a wrong command.
run this command to fix other potential problems, if there are any :
sudo -u www-data php occ maintenance:repair

@Mageunic,

This command gives me no errors:

root@cloud:/var/www/nextcloud# sudo -u www-data php occ maintenance:repair

  • Repair MySQL collation
    • Not a mysql database -> nothing to do
  • Repair mime types
  • Clean tags and favorites
    • 0 tags of deleted users have been removed.
    • 0 tags for delete files have been removed.
    • 0 tag entries for deleted tags have been removed.
    • 0 tags with no entries have been removed.
  • Repair invalid shares
  • Move .step file of updater to backup location
  • Add move avatar background job
    • Repair step already executed
  • Add preview cleanup background jobs
  • Fix potential broken mount points
    • No mounts updated
  • Repair language codes
  • Install new core bundle components
  • Add log rotate job
  • Clear frontend caches
    • Image cache cleared
    • SCSS cache cleared
    • JS cache cleared
  • Clear every generated avatar on major updates
  • Add preview background cleanup job
  • Queue a one-time job to cleanup old backups of the updater
  • Cleanup invalid photocache files for carddav
  • Add background job to cleanup login flow v2 tokens
  • Remove potentially over exposing share links
    • No need to remove link shares.
  • Clear access cache of projects
  • Reset generated avatar flag
  • Keep legacy encryption enabled
  • Check encryption key format
  • Remove old dashboard app config data
  • Update name of the stored view
  • Fix component of birthday calendars
    • 1 birthday calendars updated.
  • Regenerating birthday calendars to use new icons and fix old birthday events without year
    • Repair step already executed
  • Fix broken values of calendar objects
    0 [->--------------------------]
  • Registering building of calendar search index as background job
    • Repair step already executed
  • Registering background jobs to update cache for webcal calendars
    • Added 0 background jobs to update webcal calendars
  • Registering building of calendar reminder index as background job
    • Repair step already executed
  • Clean up orphan event and contact data
    • 0 events without a calendar have been cleaned up
    • 0 properties without an events have been cleaned up
    • 0 changes without a calendar have been cleaned up
    • 0 cached events without a calendar subscription have been cleaned up
    • 0 changes without a calendar subscription have been cleaned up
    • 0 contacts without an addressbook have been cleaned up
    • 0 properties without a contact have been cleaned up
    • 0 changes without an addressbook have been cleaned up
  • Remove activity entries of private events
    • Removed 0 activity entries
  • Fix the share type of guest shares when migrating from ownCloud
  • Copy the share password into the dedicated column
  • Set existing shares as accepted
  • Update OAuth token expiration times
  • Switches from default updater server to the customer one if a valid subscription is available
    • Repair step already executed
  • Send an admin notification if monthly report is disabled
  • Add background job to check for backup codes
  • Populating added database structures for workflows
    root@cloud:/var/www/nextcloud#

Could you tell me what “occ” is? I know a couple of commands that use occ and i know you have to run it from /var/www/nextcloud but what is “occ”?

@Operations
OCC is the nextcloud command-line interface. This is why you must use occ in nextcloud directory.
OCC allows you to perform certain actions that are not present on the web interface.

Read this for more information and more command about OCC:
https://docs.nextcloud.com/server/20/admin_manual/configuration_server/occ_command.html

sudo -u www-data php occ maintenance:repair
this command allow to check and repair some issue ( NOT ALL) on your nextcloud installation