@@ -325,7 +325,7 @@ There are also several techniques to remedy this, which are described extensivel
325325the `Sabre DAV website <http://sabre.io/dav/service-discovery/ >`_.
326326
327327Troubleshooting sharing
328- -----------------------------------
328+ -----------------------
329329
330330Users' Federated Cloud IDs not updated after a domain name change
331331^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -375,32 +375,63 @@ Troubleshooting contacts & calendar
375375Troubleshooting data-directory
376376------------------------------
377377
378- If you have a fresh install, consider reinstalling with your preferred directory location.
378+ Moving the data directory / changing the ``datadirectory `` path
379+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
379380
380- Unofficially moving the data directory can be done as follows:
381+ For local storage, Nextcloud identifies storage by its absolute path on disk.
382+ Ideally, the location of the data directory should not change after deployment. If
383+ this is a new installation, consider reinstalling with your preferred directory
384+ location before moving into production.
381385
382- 1. Make sure no cron jobs are running
383- 2. Stop apache
384- 3. Move /data to the new location
385- 4. Change the config.php entry
386- 5. Edit the database: In oc_storages change the path on the local::/old-data-dir/ entry
387- 6. Ensure permissions are still correct
388- 7. Restart apache
386+ .. danger ::
387+ If you must change the ``datadirectory `` path -- unless the transition is handled
388+ carefully -- Nextcloud will treat its content as "new storage." This can trigger
389+ duplicate or orphaned files, lost file metadata, and the loss of previously shared
390+ links.
389391
390- .. warning ::
391- However this is not supported and you risk breaking your database.
392+ For safely moving the data directory, the recommended actions are:
393+
394+ 1. Make sure no cron jobs are running and, if using system cron, that the Nextcloud crontab entry is disabled.
395+
396+ 2. Stop web/app server(s).
397+
398+ 3. Move ``/data `` to the new location (ensure you also move hidden/dot files such as ``.ncdata ``).
399+
400+ 4. Create a symlink from the original location to the new location.
401+
402+ 5. Ensure permissions are still correct (including for any parent folders).
403+
404+ 6. Restart web/app server(s).
405+
406+ 7. Re-enable Nextcloud's system crontab entry (if applicable).
407+
408+ .. note ::
409+ You may need to configure your web server to support symlinks.
410+
411+ It is also possible to move the data directory without using symlinks, but
412+ this requires manually modifying the internal ``oc_storages `` database table:
413+
414+ 1. Make sure no cron jobs are running and, if using system cron, that the Nextcloud crontab entry is disabled.
415+
416+ 2. Stop web/app server(s).
417+
418+ 3. Move ``/data `` to the new location (ensure you also move hidden/dot files such as ``.ncdata ``).
419+
420+ 4. Update the value of ``datadirectory `` in your ``config.php ``.
421+
422+ 5. Edit the database: In the ``oc_storages `` table, update the path portion of the ``id `` field of the entry
423+ beginning with ``local::/old-data-dir/ `` (e.g., change ``local::/old-data-dir/ `` to ``local::/new-data-dir/ ``).
424+
425+ 6. Ensure permissions are still correct (including for any parent folders).
392426
393- For a safe moving of data directory, supported by Nextcloud, recommended actions are:
427+ 7. Restart web/app server(s).
394428
395- 1. Make sure no cron jobs are running
396- 2. Stop apache
397- 3. Move /data to the new location
398- 4. Create a symlink from the original location to the new location
399- 5. Ensure permissions are still correct
400- 6. Restart apache
429+ 8. Re-enable Nextcloud's system crontab entry (if applicable).
401430
402431.. warning ::
403- Note, you may need to configure your webserver to support symlinks.
432+ This method is not supported and you risk breaking your database. Always make sure you
433+ have up-to-date backups -- including your database -- and a working (tested) restore
434+ process **before ** attempting this.
404435
405436Troubleshooting quota or size issues
406437------------------------------------
0 commit comments