How to Sync Nextcloud for Seamless Data Sharing

Author

Reads 161

Close-up of a laptop and smartphone connected via USB cable for data transfer.
Credit: pexels.com, Close-up of a laptop and smartphone connected via USB cable for data transfer.

Syncing Nextcloud is a game-changer for seamless data sharing. It allows you to access and share your files from anywhere, on any device.

To get started, you need to set up Nextcloud on your server, which can be done using a one-click installer. This will give you a web interface to manage your files.

Nextcloud uses a client-server architecture, which means your files are stored on the server and synced across all your devices. This ensures that your files are always up-to-date and accessible.

By syncing your Nextcloud account, you can access your files from any device with an internet connection, making it perfect for remote work or travel.

Configuring Nextcloud Sync

There are two methods to sync your database with Nextcloud: the iOS Files method and the WebDAV method. Both are described below, but we recommend using the WebDAV method for a slightly more reliable sync.

The WebDAV method is a bit slower, but it's a more reliable option. You can find the WebDAV URL by clicking on the small settings icon at the bottom left of your Nextcloud interface, which looks like https://your-server.com/remote.php/webdav/ or https://example.com/remote.php/dav/files/USER.

To configure the WebDAV method, tap the '+' on the home screen, then tap 'Add Existing Database', followed by 'WebDAV'. Enter the WebDAV URL of your Nextcloud, then navigate to your database and tap to select it.

Configuring Instant Uploads

Crop anonymous male looking through files and folder in box placed on desk with green bankers lamp in home office
Credit: pexels.com, Crop anonymous male looking through files and folder in box placed on desk with green bankers lamp in home office

You have three choices for what to do with the local file when configuring instant uploads for a directory.

To minimize clutter, it's recommended to move the original file to the app folder.

This way, the file gets uploaded to Nextcloud, and it remains accessible locally in the gallery app.

The original file is still there, but it's no longer taking up space in its original location.

This option also means you don't need the Nextcloud app to view and share your pictures.

Here are your options:

  1. Original file will be deleted.
  2. Original file will be moved to the app folder (recommended).
  3. Original file will remain in place.

Sync Database with Nextcloud or ownCloud

Syncing your database with Nextcloud or ownCloud is a straightforward process. You have two methods to choose from: the iOS Files method and the WebDAV method. The WebDAV method is recommended due to its reliability, although it may be slower.

To use the WebDAV method, you'll need to find your Nextcloud WebDAV URL. This can be done by clicking on the settings icon at the bottom left of your Nextcloud interface, which will reveal the URL in the form of https://your-server.com/remote.php/webdav/ or https://example.com/remote.php/dav/files/USER.

Detailed view of a black data storage unit highlighting modern technology and data management.
Credit: pexels.com, Detailed view of a black data storage unit highlighting modern technology and data management.

You can also find the URL in the Root URL hint text. Once you have the URL, you can navigate to your database and select it.

To set up the WebDAV method, follow these steps:

  1. Tap ‘+’ on the home screen
  2. Tap ‘Add Existing Database’
  3. Tap ‘WebDAV’
  4. Enter the WebDAV URL of your Nextcloud
  5. Now you can navigate to your database and tap to select it

Alternatively, you can use the Nextcloud App to access your database directly. To do this, install the Nextcloud App, login to Nextcloud through it, and then open your database directly through Files > Locations > Nextcloud.

If you make changes to your database, you should open the Nextcloud app and head to the database location to verify the sync. This ensures that your changes are synced correctly.

Syncing Data

Syncing data with Nextcloud is a seamless process that keeps files in two separate repositories the same. If a file is added to one repository, it's copied to the other synchronized repository.

Here's what you need to know about the synchronization process:

  • If a file is changed in one repository, the change is propagated to any other synchronized repository.
  • If a file is deleted in one repository, it's deleted in any other.
  • Nextcloud doesn't use a typical client/server system where the server is always master, which is a major difference from other systems like file backups.

The Nextcloud Client checks both repositories for changes frequently, a process called a sync run. This happens frequently, and in between sync runs, the local repository is monitored by a file system monitoring process that starts a sync run immediately if something was edited, added, or removed.

The sync process is designed to be efficient and automatic, so you can focus on what matters most.

Sync Process and Settings

A Person Holding a Folder of a Top Secret Files Label
Credit: pexels.com, A Person Holding a Folder of a Top Secret Files Label

The Nextcloud sync process is a two-way street, where changes made to files in one repository are automatically propagated to the other synchronized repository. This means that if you add, modify, or delete a file in one location, it will be updated in the other location as well.

During a sync run, the Nextcloud Client checks both repositories for changes frequently, ensuring that everything stays in sync. This process is crucial for maintaining consistency across all your devices.

Here's a breakdown of what happens during a sync run:

  • If a file is added to one repository, it is copied to the other synchronized repository.
  • When a file is changed in one repository, the change is propagated to any other synchronized repository.
  • If a file is deleted in one repository, it is deleted in any other.

Note that the sync process is not a one-time action, but rather an ongoing process that happens frequently to ensure everything stays up to date.

The Synchronization Process

The synchronization process in Nextcloud is a powerful feature that keeps files in two separate repositories the same. It's like having a magic copy-paste button that updates files across all your devices.

If a file is added to one repository, it's copied to the other synchronized repository. This means you can access your files from anywhere, without having to worry about missing anything.

Close-up Photo of Document Files
Credit: pexels.com, Close-up Photo of Document Files

When a file is changed in one repository, the change is propagated to any other synchronized repository. This ensures that your files are always up-to-date, no matter where you access them from.

If a file is deleted in one repository, it's deleted in any other. This might seem obvious, but it's a crucial part of the synchronization process.

The Nextcloud Client checks both repositories for changes frequently, a process referred to as a sync run. This happens frequently, so you don't have to worry about waiting for a long time for your files to sync.

The synchronization process is different from a typical client-server system, where the server is always the master. Nextcloud is more like a team effort, where all devices work together to keep your files in sync.

Here are the key benefits of the Nextcloud synchronization process:

  • Files are copied to the other repository when added
  • Changes are propagated to all synchronized repositories
  • Deleted files are removed from all repositories

Synchronization by Time vs ETag

Until the release of the client version 1.1, the Nextcloud synchronization process employed a single file property – the file modification time – to decide which file was newer and needed to be synchronized to the other repository.

Asian businessman focused on laptop work in modern office with documents and coffee.
Credit: pexels.com, Asian businessman focused on laptop work in modern office with documents and coffee.

This approach relied on the modification timestamps of files, which are part of the files metadata and available on every relevant filesystem. Modification timestamps have a general meaning and don't require special action to create.

Before client version 1.1.0, csync required both device repositories to run on the exact same time, which was achieved through the use of enterprise standard NTP time synchronization on all machines. This timing strategy is rather fragile without the use of NTP.

However, this approach had its limitations, and the Nextcloud server provides a unique number that changes whenever the file changes. This unique number is transmitted in the Etag field and is guaranteed to determine if one of the files has changed.

The use of Etag has been a game-changer in synchronization, as it allows the client to launch a synchronization process even if the file modification times are not in sync. This is especially useful when dealing with files that have been modified on different systems.

The client now employs a binary check to determine if files differ, rather than relying solely on timestamp conflicts. This change has significantly improved the accuracy of synchronization and reduced the likelihood of false conflict files.

The use of unique IDs for directories has also improved synchronization efficiency, as the client only analyzes directories with a modified ID. This recursive process reduces the effort required for a synchronization cycle.

Sync Cases and Exceptions

Credit: youtube.com, Nextcloud: Users & desktop sync

Syncing cases and exceptions in Nextcloud is a straightforward process.

To sync cases, you need to have a Nextcloud account and a client app installed on your device. You can find the client app on the Nextcloud website.

Nextcloud uses the WebDAV protocol to sync files, which allows you to access your files from any device with an internet connection.

Synchronizing Contacts and Calendar

You can synchronize your contacts and calendar with DAVx⁵, which is a great option for those who want to keep their data organized across multiple devices.

To get started, you'll need to download and install F-Droid, a popular app store for Android.

Once you have F-Droid installed, you can install DAVx⁵ directly from the store.

After installing DAVx⁵, you'll need to configure it via the Nextcloud app.

DAVx⁵ is a powerful tool that allows you to sync your contacts and calendar with Nextcloud, making it easy to access your data from anywhere.

Comparison Cases

A Man Orange Knit Cap Uploading Files on a Laptop
Credit: pexels.com, A Man Orange Knit Cap Uploading Files on a Laptop

Comparison Cases are an essential part of syncing files between your local device and a remote repository like Nextcloud.

The modification time is a good attribute to use for detecting changes on the local side, as it doesn't depend on time shifts or other factors.

The client compares the ETag of each file with its expected value on the remote side, and if they match, no synchronization occurs.

If a file has changed on both sides since the last sync run, a conflict case is created, and the client resolves it by renaming the local file and saving the remote file under the original name.

Conflict files are always created on the client and never on the server, and the path checked is the relative path under the sync root directory.

Sync Journal and Logs

The Sync Journal is a per-directory database that stores the ETag number, a hidden file contained in the directory to be synchronized.

This database is rebuilt by the Nextcloud Client CSync backend if it's removed, by comparing files and their modification times.

The process ensures both the server and client are synchronized using the appropriate NTP time before restarting the client following a database removal.

Customizing Sync

Credit: youtube.com, How to sync settings between multiple computers using Nextcloud or other cloud software provider

Custom WebDAV properties were introduced to enhance sync functionality and performance. They're essential for a seamless syncing experience.

To access these properties, you can send a PROPFIND request on a file or directory. The server will return additional XML elements in the namespace oc.

If you're using Nextcloud on Windows, you'll find that this feature is available by default. However, on Linux and macOS, you'll need to enable experimental options by adding showExperimentalOptions=true to the nextcloud.cfg configuration file in the AppData folder.

Ignored Files

The Nextcloud Client gives you control over which files are synced, and it's great to know what files are ignored by default. By default, the client ignores files with a name longer than 254 characters.

You can also add custom patterns to exclude certain files from syncing. The client uses the UNIX standard C library function fnmatch to match filenames against these patterns. This process checks the filename against the specified pattern using standard shell wildcard pattern matching.

Hands Holding a Smartphone with Data on Screen
Credit: pexels.com, Hands Holding a Smartphone with Data on Screen

Some system-wide file patterns are included with the client by default. These patterns are used to exclude or ignore files that are reserved for journalling, such as files starting with ._sync_*.db*, .sync_*.db*, .csync_journal.db*, .owncloudsync.log*.

The client also ignores files with a name that includes certain characters that don't work on typical Windows filesystems, such as \,/,:,?,*",,>,<,|. Additionally, it ignores files with a trailing space or dot on Windows.

Here are some examples of file patterns and the files they match:

The client will also remove files that are considered fleeting meta data, such as files created by some applications that have no sustainable meaning.

Custom WebDAV Properties

Custom WebDAV Properties can enhance your sync experience. These properties are used in the communication between the client and server, and they're either necessary for sync functionality or can improve synchronization performance.

The Nextcloud server returns custom XML elements in response to a successful PROPFIND request on a file or directory. These elements are returned in the namespace oc.

Positive young female remote specialists with short dark hair in casual clothes sitting on sofa and chatting while working online on laptop and reading documents
Credit: pexels.com, Positive young female remote specialists with short dark hair in casual clothes sitting on sofa and chatting while working online on laptop and reading documents

Custom WebDAV Properties are currently only available on Windows by default. To enable them on Linux or macOS, you need to add showExperimentalOptions=true to the nextcloud.cfg configuration file in the AppData folder.

These properties can be accessed through the Nextcloud app, but only on Windows. On Linux and macOS, you need to enable experimental options to use them.

Virtual Files and Sync

Syncing files and directories in Nextcloud is a straightforward process. To synchronize a directory, navigate to its parent directory in the Nextcloud app, open the menu, and select 'Synchronize'. This will download the files and directories from the server to your phone.

New files will not be continuously synchronized, so you'll need to repeat the process if you want to update the files on your phone. The syncing icon will briefly appear on the file's icon, and disappear when done.

To download a remote file to your phone and make it accessible to other applications via the media gallery, navigate to the file's directory, open the menu on the file you want to download, and select 'Download'. This marks the file as 'available offline', and a green check mark will appear on the file's icon.

Close-up of a smartphone displaying an app interface with a blurred bokeh background for a modern tech feel.
Credit: pexels.com, Close-up of a smartphone displaying an app interface with a blurred bokeh background for a modern tech feel.

However, only one-way sync is supported, meaning files added, modified, or deleted on the server are updated on the client device, but files added on the device are not updated on the server.

The Nextcloud client stores the ETag number in a per-directory database, called the journal. This hidden file is contained in the directory to be synchronized, and is used to keep track of file changes.

If the journal database is removed, the Nextcloud Client CSync backend rebuilds the database by comparing the files and their modification times. This ensures that both server and client are synchronized using the appropriate NTP time before restarting the client following a database removal.

Sync with Nextcloud Mobile App

You can sync your Nextcloud data with your Android device using the Nextcloud mobile app. First, install DAVx⁵ from the Google Play Store or F-Droid.

To get started, go to Settings/More in the Nextcloud mobile app and tap on “Sync calendars & contacts”. DAVx⁵ will then open and ask you to create an account. Set the account name to one of your choosing, and set Contact Group Method to “Groups are per-contact categories”.

Close-up view of modern rack-mounted server units in a data center.
Credit: pexels.com, Close-up view of modern rack-mounted server units in a data center.

The process is a bit involved, but it's worth it for the convenience of having your data synced across devices. You'll need to grant access to your calendars and contacts, and optionally, install OpenTasks and grant access to your tasks as well.

Here's a step-by-step guide to help you through the process:

  1. Install DAVx⁵ from Google Play Store or F-Droid.
  2. Go to Settings/More in the Nextcloud mobile app and tap on “Sync calendars & contacts”.
  3. Enter your email address as DAVx⁵ account name (mandatory for sending calendar invitations).
  4. Choose which address books and calendars you want to synchronize and finish.

Nextcloud Mobile App

To sync your calendars and contacts with Nextcloud using the mobile app, you'll need to install DAVx⁵ on your Android device. You can find it on Google Play Store or F-Droid.

First, go to Settings/More in the Nextcloud mobile app and tap on “Sync calendars & contacts”. This will open DAVx⁵ and prompt you to enter your Nextcloud Webflow login credentials and grant access.

To create an account with DAVx⁵, set the account name to your email address, which is mandatory for sending calendar invitations. You can also choose to install OpenTasks for task synchronization.

After setting up your account, tap on the icon for the account DAVx⁵ has created to grant access to your calendars and contacts. If you want to synchronize tasks, you can also grant access to OpenTasks.

DAVx⁵ will then discover the available address books and calendars on your Nextcloud account. Choose which ones you want to synchronize and finish the setup.

Mobile App Missing

Computer server in data center room
Credit: pexels.com, Computer server in data center room

If you're missing the Nextcloud mobile app, don't worry, you can still sync your data. You can use DAVx⁵, a third-party app that allows you to sync your contacts, calendars, and tasks with Nextcloud.

To get started, you'll need to install DAVx⁵ from the Google Play Store or F-Droid. This will give you access to your Nextcloud data on your Android device.

You'll also need to install OpenTasks if you want to sync your tasks. This app can be found on the Google Play Store or F-Droid.

Creating a new account is a straightforward process that begins with the "+" button. From there, you can select the connection method that works best for you, using the URL of your Nextcloud instance and your credentials.

DAVx⁵ has a unique way of handling contact groups, so make sure to choose the option "Groups are per contact categories" when prompted.

If you're using two-factor authentication, you won't be able to use your username and password to connect. Instead, you'll need to use a dedicated app password.

Woman in focus working on software development remotely on laptop indoors.
Credit: pexels.com, Woman in focus working on software development remotely on laptop indoors.

Here are the steps to connect DAVx⁵ to your Nextcloud instance:

  1. Install DAVx⁵ from the Google Play Store or F-Droid.
  2. Optionally install OpenTasks from the Google Play Store or F-Droid.
  3. Create a new account using the "+" button.
  4. Select Connection with URL and username.
  5. Choose the option "Groups are per contact categories" for Contact Group Method.
  6. Click Connect.
  7. Select the data you want to sync.
  8. Grant access permissions to DAVx⁵ for your contacts, calendars, and optionally tasks.

If you're also using the Nextcloud Calendar app, you'll need to install ICSx⁵ to sync your calendar subscriptions. DAVx⁵ will list the calendar subscriptions, but you won't be able to sync them without this additional app.

Desktop Sync and Installation

To sync your Nextcloud files across devices, you'll first need to install the Desktop Synchronization Client. You can download the latest version from the Nextcloud download page, which offers clients for Linux, macOS, and Microsoft Windows.

The client will automatically keep itself updated, so you don't have to worry about manually updating it. However, Linux users will need to add the appropriate repository for their Linux distribution, install the signing key, and then use their package manager to install the desktop sync client.

To install the client on Linux, you'll need to follow the instructions on the download page, which includes adding the repository, installing the signing key, and then using your package manager to install the client. This will also allow you to update your sync client via package manager, and the client will display a notification when an update is available.

Focused woman working in a modern office filled with files and equipment.
Credit: pexels.com, Focused woman working in a modern office filled with files and equipment.

You can also choose to only install the client itself by using the following command: `msiexec/passive/iNextcloud-x.y.z-x64.msiADDDEFAULT=StartMenuShortcuts`. This will install everything but the Desktop Shortcut and Shell Extensions feature.

Alternatively, you can pass the `NO_DESKTOP_SHORTCUT` and `NO_SHELL_EXTENSIONS` properties to install only the client itself: `msiexec/passive/iNextcloud-x.y.z-x64.msiNO_DESKTOP_SHORTCUT="1"NO_SHELL_EXTENSIONS="1"`. The Nextcloud .msi remembers these properties, so you don't need to specify them on upgrades.

Here's a summary of the installation options:

Linux users will also need to have a password manager enabled, such as GNOME Keyring or KWallet, so that the sync client can login automatically. This will allow you to sync your files across devices without having to manually enter your login credentials.

Frequently Asked Questions

How often does Nextcloud sync?

Nextcloud syncs every 1 minute to ensure your data is always up to date. This frequent syncing helps you stay organized and ensures seamless collaboration.

How do I transfer my Nextcloud to another server?

To transfer Nextcloud to another server, set the old server to maintenance mode and wait 10 minutes, then import the database dump from phpMyAdmin on the new server. This process involves several steps, including setting up the database and creating a database dump.

Margaret Schoen

Writer

Margaret Schoen is a skilled writer with a passion for exploring the intersection of technology and everyday life. Her articles have been featured in various publications, covering topics such as cloud storage issues and their impact on modern productivity. With a keen eye for detail and a knack for breaking down complex concepts, Margaret's writing has resonated with readers seeking practical advice and insight.

Love What You Read? Stay Updated!

Join our community for insights, tips, and more.