summaryrefslogtreecommitdiffstats
path: root/nextcloud-MIGRATION.fedora
blob: e3c1e11d158a1a6602c62957ee6b02d044af9f97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Migration from owncloud
=======================

### Prevent people using owncloud
sudo -u apache php /usr/share/owncloud/occ maintenance:mode --on


### If enough disk space for temporary double data usage
## Copy data over from one location to the other
rsync -aPh /var/lib/owncloud/ /var/lib/nextcloud/

## If wanting to rename the database
mysql -e 'create database nextclouddb;'
mysql -e "grant all on nextclouddb.* to 'nextcloud_user'@'localhost' identified by 'nextcloud_pass';"
mysqldump -v ownclouddb | mysql  -D nextclouddb


### If not enough space for temporary double data
## Copy data over from one location to the other
mv /var/lib/owncloud/* /var/lib/nextcloud/

## If wanting to rename the database
mysql -e 'create database nextclouddb'
mysql -e "grant all on nextclouddb.* to 'nextcloud_user'@'localhost' identified by 'nextcloud_pass';"
mysql ownclouddb -sNe 'show tables' | while read table;  do mysql  -sNe "rename table ownclouddb.$table to nextclouddb.$table;"; done


### Bring over the old configuration and update paths
cp /etc/owncloud/config.php /etc/nextcloud/config.php
sed -i '/owncloud/nextcloud/g' /etc/nextcloud/config.php


### Enable the nextcloud interface on httpd
ln -s /etc/httpd/conf.d/nextcloud-access.conf.avail /etc/httpd/conf.d/z-nextcloud-access.conf

### Carry out any migration required
sudo -u apache php /usr/share/nextcloud/occ upgrade


### Enable allow people to use nextcloud
sudo -u apache php /usr/share/nextcloud/occ maintenance:mode --off


### Clean up the owncloud stuff after testing
dnf remove -y owncloud\*
rm -rf /var/lib/owncloud /etc/owncloud
mysql -e 'drop database ownclouddb;'