Project

General

Profile

Moving Nextcloud to a New Server » History » Version 1

Gareth Eaton, 10/16/2023 12:46 AM

1 1 Gareth Eaton
h1. Moving Nextcloud to a New Server
2
3
1. Backup old nextcloud data folder I use filebrowser for https://filebrowser.org
4
5
<pre>
6
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash
7
</pre>
8
 
9
The login 
10
<pre>
11
filebrowser -a 192.168.*.* -p 8080
12
</pre>
13
14
Login to it using your web browser http://192.168.*.*:8080 NOTE: change the 192.168.*.* with you IP address.
15
16
Download the Nextcloud/Data folder
17
18
2. In the CLI back up your mysql database, mysql -u your_mysql_username -p your_database_name < your_backup_file.sql
19
 in my case
20
<pre>
21
mysql -u nextcloud -p nextcloud < nextcloud-sqlbkp.bak
22
</pre>
23
24
25
3. install a new copy of ubuntu 20.04 on your new server, update and follow the in stall instinstrushion for a new copy of nextcloud, when you get to add user call it nextcloud-admin
26
27
put the install in to sudo -u www-data php occ maintenance:mode --on
28
29
<pre>
30
sudo -u www-data php occ maintenance:mode --on
31
</pre>
32
33
4. now using fileziller upload the database and data folder to the new server
34
5. use rsyne to mv the data to the nexcloud/data folder
35
<pre>
36
sudo rsync -avP source_directory/ /var/www/html/nextcloud/data/
37
</pre>
38
39
6. restore the data base, mysql -u your_mysql_username -p your_database_name < your_backup_file.sql
40
41
<pre>
42
mysql -u nextcloud -p nextcloud < nextcloud-sqlbkp.bak
43
</pre>
44
45
7. now you should be able to accsess