Skip to content

Commit

Permalink
Nextcloud with Let's Encrypt Using Docker Compose
Browse files Browse the repository at this point in the history
  • Loading branch information
heyvaldemar authored Oct 11, 2024
1 parent 6136ec8 commit 022295f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ This script facilitates the restoration of a database backup:

6. **Start Service**: Restarts the service after the restoration is completed.

To make the `nextcloud-restore-database.shh` script executable, run the following command:
To make the `nextcloud-restore-database.sh` script executable, run the following command:

`chmod +x nextcloud-restore-database.sh`

Expand Down Expand Up @@ -116,6 +116,23 @@ Confirm the indices were added by checking the status:
- Operations on large databases can take time; consider scheduling during low-usage periods.
- Always backup your database before making changes.

# Rescanning Files

When files are added directly to Nextcloud's data directory through methods other than the web interface or sync clients (e.g., via FTP or direct server access), they are not automatically visible in the Nextcloud user interface. This happens because these files bypass Nextcloud's normal indexing process.

To make all manually added files visible in the UI, you can use the `occ files:scan` command to update Nextcloud's file index. This command should be used with care as it can impact server performance, especially on larger installations.

List all running containers to find the one running Nextcloud:

`docker ps`

Run the command below, replacing `nextcloud-container-name` with your container's name. Adjust `33` to the correct user ID if different:

`docker exec -u 33 -it nextcloud-container-name php occ files:scan --all`

- Be aware that this command can significantly affect performance during its execution. It is advisable to run this scan during periods of low user activity.
- Always ensure that you have up-to-date backups before performing any operations that affect the filesystem or database.

# Author

I’m Vladimir Mikhalev, the [Docker Captain](https://www.docker.com/captains/vladimir-mikhalev/), but my friends can call me Valdemar.
Expand Down
22 changes: 20 additions & 2 deletions nextcloud-traefik-letsencrypt-docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
# 4. **Stop Service**: Temporarily stops the service to ensure data consistency during restoration.
# 5. **Restore Database**: Executes a sequence of commands to drop the current database, create a new one, and restore it from the selected compressed backup file.
# 6. **Start Service**: Restarts the service after the restoration is completed.
# To make the `nextcloud-restore-database.shh` script executable, run the following command:
# To make the `nextcloud-restore-database.sh` script executable, run the following command:
# `chmod +x nextcloud-restore-database.sh`
# Usage of this script ensures a controlled and guided process to restore the database from an existing backup.

Expand All @@ -64,7 +64,9 @@
# By utilizing this script, you can efficiently restore application data from an existing backup while ensuring proper coordination with the running service.

# # Fixing Database Index Issues
# Your Nextcloud database might be missing some indexes. This situation can occur because adding indexes to large tables can take considerable time, so they are not added automatically. Running `occ db:add-missing-indices` manually allows these indexes to be added while the instance continues running. Adding these indexes can significantly speed up queries on tables like `filecache` and `systemtag_object_mapping`, which might be missing indexes such as `fs_storage_path_prefix` and `systag_by_objectid`.
# Your Nextcloud database might be missing some indexes. This situation can occur because adding indexes to large tables can take considerable time, so they are not added automatically.
# Running `occ db:add-missing-indices` manually allows these indexes to be added while the instance continues running. Adding these indexes can significantly speed up
# queries on tables like `filecache` and `systemtag_object_mapping`, which might be missing indexes such as `fs_storage_path_prefix` and `systag_by_objectid`.

# List all running containers to find the one running Nextcloud:
# `docker ps`
Expand All @@ -78,6 +80,22 @@
# - Operations on large databases can take time; consider scheduling during low-usage periods.
# - Always backup your database before making changes.

# # Rescanning Files
# When files are added directly to Nextcloud's data directory through methods other than the web interface or sync clients
# (e.g., via FTP or direct server access), they are not automatically visible in the Nextcloud user interface.
# This happens because these files bypass Nextcloud's normal indexing process.
# To make all manually added files visible in the UI, you can use the `occ files:scan` command to update Nextcloud's file index.
# This command should be used with care as it can impact server performance, especially on larger installations.

# List all running containers to find the one running Nextcloud:
# `docker ps`

# Run the command below, replacing `nextcloud-container-name` with your container's name. Adjust `33` to the correct user ID if different:
# `docker exec -u 33 -it nextcloud-container-name php occ files:scan --all`

# - Be aware that this command can significantly affect performance during its execution. It is advisable to run this scan during periods of low user activity.
# - Always ensure that you have up-to-date backups before performing any operations that affect the filesystem or database.

# Author
# I’m Vladimir Mikhalev, the Docker Captain, but my friends can call me Valdemar.
# https://www.docker.com/captains/vladimir-mikhalev/
Expand Down

0 comments on commit 022295f

Please sign in to comment.