jmgomez-IAA / loogbook

Personal web page
0 stars 0 forks source link

Post Ideas: Backup and Sync NextCloud #49

Open jmgomez-IAA opened 4 years ago

jmgomez-IAA commented 4 years ago

Nextcloud

Introduccion

Usar nextcloud para syncronizar el movil.

Instalación de Nextcloud

https://linuxize.com/post/how-to-install-and-configure-nextcloud-on-centos-7/

jmgomez-IAA commented 4 years ago

Usefull commands

Listar todos los moudlos php instalados en el sistema:

#]$ php -m

jmgomez-IAA commented 4 years ago

Cambiar el direcotrio de trabajo de Nextcloud

Esta solucion funciona:

  1. sudo -u www-data php /path/to/nextcloud/occ maintenance:mode --on
  2. mkdir -p /new/path/to/data
  3. cp -a /path/to/data/. /new/path/to/data
  4. chown -R www-data:www-data /new/path/to/data
  5. nano /path/to/nextcloud/config/config.php 'datadirectory' => '/new/path/to/data',
  6. mysqldump -u -p > /path/to/dbdump/dump.sql
  7. Adjust "oc_storages"database table to reflect the new data folder location: mysql -u -p //enter mysql root password, then within mysql console: use ; update oc_storages set id='local::/new/path/to/data/' where id='local::/path/to/data/'; //take care about backslash at the end of path!! quit;
  8. sudo -u www-data php /path/to/nextcloud/occ maintenance:mode --off

Deespues borar el directorio antigüo. rm -R /path/to/data //old location!!

  1. rm /path/to/dbdump/dump.sql

Base de datos postgresql

[jmgomez@greencloud cloud-data-backup]$ sudo psql -d nextcloud -U nextcloud -W Password: psql (12.2) Type "help" for help.

nextcloud=> \l List of databases Name | Owner | Encoding | Collate | Ctype | Access privileges -----------+-----------+-----------+---------+-------+------------------------- nexcloud | nextcloud | SQL_ASCII | C | C | nextcloud | nextcloud | SQL_ASCII | C | C | nextcloud=CTc/nextcloud postgres | postgres | SQL_ASCII | C | C | template0 | postgres | SQL_ASCII | C | C | =c/postgres + | | | | | postgres=CTc/postgres template1 | postgres | SQL_ASCII | C | C | =c/postgres + | | | | | postgres=CTc/postgres (5 rows)

nextcloud=> SELECT nextcloud; ERROR: column "nextcloud" does not exist LINE 1: SELECT nextcloud; ^ nextcloud=> SELECT nextcloud nextcloud-> UPDATE oc_storages set id="local::/var/cloud-data" where id='local::/usr/share/webapps/nextcloud/data" nextcloud'> select * from oc_storages nextcloud'> \d oc_storages nextcloud'> quit Use control-D to quit.

Links

https://help.nextcloud.com/t/howto-change-move-data-directory-after-installation/17170

jmgomez-IAA commented 4 years ago

OCC Commands

sudo -u http php /usr/share/webapps/nextcloud/occ files:scan --all

sudo -u www-data php /usr/share/webapps/nextcloud/occ maintenance:mode --off