Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
moving_nextcloud_data [2022/03/01 18:00] warmachine created |
moving_nextcloud_data [2022/03/01 19:09] (current) warmachine |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== Moving a Next Cloud Datastore ===== | ===== Moving a Next Cloud Datastore ===== | ||
| - | this is particularly useful if you've used turnkey linux, or if you've installed nextcloud on a VM and want to move the storage to a NAS | + | this is particularly useful if you've used turnkey linux, or if you've installed nextcloud on a VM and want to move the storage to a NAS |
| + | |||
| <color # | <color # | ||
| + | turn maintenance mode on for nextcloud: | ||
| + | |||
| + | < | ||
| + | |||
| + | make a new directory for your data, copy your data to it, and have nextcloud' | ||
| + | |||
| + | < | ||
| + | cp -a / | ||
| + | chown -R www-data: | ||
| + | |||
| + | modify nextcloud config to point to this new path: | ||
| + | |||
| + | < | ||
| + | ' | ||
| + | |||
| + | change the location in the database: | ||
| + | |||
| + | < | ||
| + | |||
| + | < | ||
| + | dbpassword=$(awk -F\' "/' | ||
| + | mysql -u$dbuser -p$dbpassword</ | ||
| + | | ||
| + | Inside the MySQL console: | ||
| + | |||
| + | < | ||
| + | use < | ||
| + | update oc_storages set id=' | ||
| + | quit; | ||
| + | </ | ||
| + | | ||
| + | Again outside the MySQL console | ||
| + | |||
| + | < | ||
| + | |||
| + | turn maintenance mode off: | ||
| + | |||
| + | < | ||
| + | |||
| + | After that, carefully test Nextcloud, the files inside web ui, shares, tags, comments etc. If everything is working fine and Nextcloud indeed handles the files on the new location, you could remove the backups: | ||
| + | |||
| + | < | ||
| + | rm / | ||
Last modified: le 2022/03/01 18:00
